Skip to content

Commit

Permalink
can: gs_usb: fix return value of the "set_bittiming" callback
Browse files Browse the repository at this point in the history
The "set_bittiming" callback treats a positive return value as error!
For that reason "can_changelink()" will quit silently after setting
the bittiming values without processing ctrlmode, restart-ms, etc.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Wolfgang Grandegger authored and Marc Kleine-Budde committed Jan 4, 2018
1 parent b4c2951 commit d5b42e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/usb/gs_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ static int gs_usb_set_bittiming(struct net_device *netdev)
dev_err(netdev->dev.parent, "Couldn't set bittimings (err=%d)",
rc);

return rc;
return (rc > 0) ? 0 : rc;
}

static void gs_usb_xmit_callback(struct urb *urb)
Expand Down

0 comments on commit d5b42e6

Please sign in to comment.