Skip to content

Commit

Permalink
Fix kernel oops when connecting the wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
berarma committed Dec 26, 2019
1 parent ab5ef09 commit de30aa2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hid-lg4ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1953,9 +1953,10 @@ int lg4ff_init(struct hid_device *hid)
/* Wheel has been told to switch to native mode. There is no point in going on
* with the initialization as the wheel will do a USB reset when it switches mode
*/
if (mmode_ret == LG4FF_MMODE_SWITCHED)
return 0;
else if (mmode_ret < 0) {
if (mmode_ret == LG4FF_MMODE_SWITCHED) {
error = 0;
goto err_init;
} else if (mmode_ret < 0) {
hid_err(hid, "Unable to switch device mode during initialization, errno %d\n", mmode_ret);
error = mmode_ret;
goto err_init;
Expand Down

0 comments on commit de30aa2

Please sign in to comment.