]> git.baikalelectronics.ru Git - kernel.git/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)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 24 Oct 2017 11:00:23 +0000 (13:00 +0200)
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>
drivers/net/can/usb/kvaser_usb.c

index 18cc529fb807a4ad88fc06a201b18456040c5859..861e90efab86bd5f66f84b1a3038936162ca50ba 100644 (file)
@@ -1609,7 +1609,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);