Skip to content

Commit

Permalink
can: peak_usb: pcan_usb_get_device_id(): read value only in case of s…
Browse files Browse the repository at this point in the history
…uccess

In case of error, reading value from response argument is useless.

Link: https://lore.kernel.org/r/20210625130931.27438-2-s.grosjean@peak-system.com
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Stephane Grosjean authored and Marc Kleine-Budde committed Jul 25, 2021
1 parent 805ff68 commit 1d0214a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/can/usb/peak_usb/pcan_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ static int pcan_usb_get_device_id(struct peak_usb_device *dev, u32 *device_id)
if (err)
netdev_err(dev->netdev, "getting device id failure: %d\n", err);

*device_id = args[0];
else
*device_id = args[0];

return err;
}
Expand Down

0 comments on commit 1d0214a

Please sign in to comment.