Skip to content

Commit de30aa2

Browse files
committed
Fix kernel oops when connecting the wheel
1 parent ab5ef09 commit de30aa2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hid-lg4ff.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,9 +1953,10 @@ int lg4ff_init(struct hid_device *hid)
19531953
/* Wheel has been told to switch to native mode. There is no point in going on
19541954
* with the initialization as the wheel will do a USB reset when it switches mode
19551955
*/
1956-
if (mmode_ret == LG4FF_MMODE_SWITCHED)
1957-
return 0;
1958-
else if (mmode_ret < 0) {
1956+
if (mmode_ret == LG4FF_MMODE_SWITCHED) {
1957+
error = 0;
1958+
goto err_init;
1959+
} else if (mmode_ret < 0) {
19591960
hid_err(hid, "Unable to switch device mode during initialization, errno %d\n", mmode_ret);
19601961
error = mmode_ret;
19611962
goto err_init;

0 commit comments

Comments
 (0)