]> git.hungrycats.org Git - linux/commitdiff
can: kvaser_usb: Correct return value in printout
authorJimmy Assarsson <jimmyassarsson@gmail.com>
Tue, 24 Oct 2017 10:23:28 +0000 (12:23 +0200)
committerSasha Levin <alexander.levin@verizon.com>
Mon, 6 Nov 2017 04:54:38 +0000 (23:54 -0500)
[ Upstream commit 8f65a923e6b628e187d5e791cf49393dd5e8c2f9 ]

If the return value from kvaser_usb_send_simple_msg() was non-zero, the
return value from kvaser_usb_flush_queue() was printed in the kernel
warning.

Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/net/can/usb/kvaser_usb.c

index 8b17a9065b0b193a0c5e5a93048c637f0f7fbad3..4700485c2782d312a7e8989a5dd091f8c77cb46b 100644 (file)
@@ -1608,7 +1608,8 @@ static int kvaser_usb_close(struct net_device *netdev)
        if (err)
                netdev_warn(netdev, "Cannot flush queue, error %d\n", err);
 
-       if (kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, priv->channel))
+       err = kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, priv->channel);
+       if (err)
                netdev_warn(netdev, "Cannot reset card, error %d\n", err);
 
        err = kvaser_usb_stop_chip(priv);