linux/drivers/net/can
Manfred Schlaegl d34ea495d4 can: dev: __can_get_echo_skb(): fix bogous check for non-existing skb by removing it
commit 7b12c8189a upstream.

This patch revert commit 7da11ba5c5
("can: dev: __can_get_echo_skb(): print error message, if trying to echo non existing skb")

After introduction of this change we encountered following new error
message on various i.MX plattforms (flexcan):

| flexcan 53fc8000.can can0: __can_get_echo_skb: BUG! Trying to echo non
| existing skb: can_priv::echo_skb[0]

The introduction of the message was a mistake because
priv->echo_skb[idx] = NULL is a perfectly valid in following case: If
CAN_RAW_LOOPBACK is disabled (setsockopt) in applications, the pkt_type
of the tx skb's given to can_put_echo_skb is set to PACKET_LOOPBACK. In
this case can_put_echo_skb will not set priv->echo_skb[idx]. It is
therefore kept NULL.

As additional argument for revert: The order of check and usage of idx
was changed. idx is used to access an array element before checking it's
boundaries.

Signed-off-by: Manfred Schlaegl <manfred.schlaegl@ginzinger.com>
Fixes: 7da11ba5c5 ("can: dev: __can_get_echo_skb(): print error message, if trying to echo non existing skb")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-05-02 21:41:27 +01:00
..
c_can can: c_can: don't indicate triple sampling support for D_CAN 2018-01-01 20:52:07 +00:00
cc770 can: constify of_device_id array 2018-11-20 18:05:46 +00:00
mscan can: mpc5xxx_can: check of_iomap return before use 2018-11-20 18:05:47 +00:00
sja1000 can: constify of_device_id array 2018-11-20 18:05:46 +00:00
softing can: softing: remove unused sysfs attributes 2014-04-25 00:09:03 +02:00
spi can: mcp251x: fix resume when device is down 2015-08-11 09:57:33 +01:00
usb can: ems_usb: Fix memory leak on ems_usb_disconnect() 2018-11-20 18:05:52 +00:00
at91_can.c can: at91_can: RX queue could get stuck at high bus load 2016-08-22 22:38:17 +01:00
bfin_can.c can: Unify MTU settings for CAN interfaces 2014-03-17 09:20:16 +01:00
dev.c can: dev: __can_get_echo_skb(): fix bogous check for non-existing skb by removing it 2019-05-02 21:41:27 +01:00
flexcan.c can: flexcan: fix resume function 2016-11-20 01:17:32 +00:00
grcan.c can: constify of_device_id array 2018-11-20 18:05:46 +00:00
janz-ican3.c can: Unify MTU settings for CAN interfaces 2014-03-17 09:20:16 +01:00
Kconfig can: xilinx CAN controller support 2014-05-26 09:36:31 +02:00
led.c can: only rename enabled led triggers when changing the netdev name 2014-05-27 15:05:41 +02:00
Makefile can: xilinx CAN controller support 2014-05-26 09:36:31 +02:00
pch_can.c can: Unify MTU settings for CAN interfaces 2014-03-17 09:20:16 +01:00
rcar_can.c can: rcar_can: print signed IRQ # 2015-08-10 17:10:20 +01:00
slcan.c slcan: Port write_wakeup deadlock fix from slip 2014-06-16 21:29:13 -07:00
ti_hecc.c can: ti_hecc: Fix napi poll return value for repoll 2018-03-03 15:51:41 +00:00
vcan.c can: add destructor for self generated skbs 2014-01-30 16:25:49 -08:00
xilinx_can.c can: xilinx_can: fix incorrect clear of non-processed interrupts 2018-11-20 18:05:48 +00:00