]> git.baikalelectronics.ru Git - kernel.git/commit
can: dev: __can_get_echo_skb(): fix real payload length return value for RTR frames
authorOliver Hartkopp <socketcan@hartkopp.net>
Tue, 20 Oct 2020 06:44:43 +0000 (08:44 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 3 Nov 2020 21:30:12 +0000 (22:30 +0100)
commit2e8cec9705940cfe2c7e574d37c3c0c5f63fc715
tree256475d8dfef1a1ac01dd8ce0641a36833ad538c
parent121d6f9f36b9af3fd33009c820a9fe73cda33442
can: dev: __can_get_echo_skb(): fix real payload length return value for RTR frames

The can_get_echo_skb() function returns the number of received bytes to
be used for netdev statistics. In the case of RTR frames we get a valid
(potential non-zero) data length value which has to be passed for further
operations. But on the wire RTR frames have no payload length. Therefore
the value to be used in the statistics has to be zero for RTR frames.

Reported-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/r/20201020064443.80164-1-socketcan@hartkopp.net
Fixes: 8591c318fdf4 ("can: dev: let can_get_echo_skb() return dlc of CAN frame")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev.c