]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: gs_usb: gs_usb_receive_bulk_callback(): count RX overflow errors also in case...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 4 Jul 2023 09:23:37 +0000 (11:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:02 +0000 (09:48 +0200)
commitd273f36ef6be4b3fffbf5113f285c1eb82e5edfd
treefdc51bc79da956c2091abb925b58e34c2676f471
parent33ac54d56928ad9b0cef16149ae0c18a7a606fd8
can: gs_usb: gs_usb_receive_bulk_callback(): count RX overflow errors also in case of OOM

[ Upstream commit 6c8bc15f02b85bc8f47074110d8fd8caf7a1e42d ]

In case of an RX overflow error from the CAN controller and an OOM
where no skb can be allocated, the error counters are not incremented.

Fix this by first incrementing the error counters and then allocate
the skb.

Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices")
Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-7-c3b9154ec605@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/usb/gs_usb.c