can: bcm: check the result of can_send() in bcm_can_tx()
authorZiyang Xuan <william.xuanziyang@huawei.com>
Thu, 15 Sep 2022 01:55:56 +0000 (09:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:36 +0000 (12:35 +0200)
commit4a5eab200e434f78b2d89eee27d1802bc1cf680f
tree40049697bb55b9a33d9acb5f60aa31435a9dcaba
parent3423a50fa018e88aed4c900d59c3c8334d8ad583
can: bcm: check the result of can_send() in bcm_can_tx()

[ Upstream commit 3fd7bfd28cfd68ae80a2fe92ea1615722cc2ee6e ]

If can_send() fail, it should not update frames_abs counter
in bcm_can_tx(). Add the result check for can_send() in bcm_can_tx().

Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Suggested-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Link: https://lore.kernel.org/all/9851878e74d6d37aee2f1ee76d68361a46f89458.1663206163.git.william.xuanziyang@huawei.com
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/can/bcm.c