]> git.baikalelectronics.ru Git - kernel.git/commit
can: isotp: isotp_bind(): do not validate unused address information
authorOliver Hartkopp <socketcan@hartkopp.net>
Tue, 17 May 2022 14:56:53 +0000 (16:56 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 19 May 2022 20:11:28 +0000 (22:11 +0200)
commit9d79b10242d7528335096e3f791e67aae06f0745
tree7b453791dfaa26c95dd6bf863a3ac249629c7275
parent47aaa365d19002d943b3d6b23a7474b693a0fc23
can: isotp: isotp_bind(): do not validate unused address information

With commit d3d6c82ec163 ("can: isotp: isotp_bind(): return -EINVAL on
incorrect CAN ID formatting") the bind() syscall returns -EINVAL when
the given CAN ID needed to be sanitized. But in the case of an unconfirmed
broadcast mode the rx CAN ID is not needed and may be uninitialized from
the caller - which is ok.

This patch makes sure the result of an inproper CAN ID format is only
provided when the address information is needed.

Link: https://lore.kernel.org/all/20220517145653.2556-1-socketcan@hartkopp.net
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/isotp.c