can: dev: __can_get_echo_skb(): print error message, if trying to echo non existing skb
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 31 Oct 2018 13:15:13 +0000 (14:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:47:59 +0000 (09:47 +0100)
commit7da5b2c86649f03062f8dd961c3fc19ff15a4155
tree7a2c684f78534d675c2c3629710e129a0707b9bb
parenta02dbcb5c7cf594657d063fef21326f32f2448aa
can: dev: __can_get_echo_skb(): print error message, if trying to echo non existing skb

commit 7da11ba5c5066dadc2e96835a6233d56d7b7764a upstream.

Prior to echoing a successfully transmitted CAN frame (by calling
can_get_echo_skb()), CAN drivers have to put the CAN frame (by calling
can_put_echo_skb() in the transmit function). These put and get function
take an index as parameter, which is used to identify the CAN frame.

A driver calling can_get_echo_skb() with a index not pointing to a skb
is a BUG, so add an appropriate error message.

Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/dev.c