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)
commitb76b163f46b661499921a0049982764a6659bfe7
tree7b453791dfaa26c95dd6bf863a3ac249629c7275
parentd7e6f5836038eeac561411ed7a74e2a225a6c138
can: isotp: isotp_bind(): do not validate unused address information

With commit 2aa39889c463 ("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