Skip to content

Commit 33812fc

Browse files
tititiou36Jiri Kosina
authored andcommitted
HID: magicmouse: Fix an error handling path in magicmouse_probe()
If the timer introduced by the commit below is started, then it must be deleted in the error handling of the probe. Otherwise it would trigger once the driver is no more. Fixes: 0b91b4e ("HID: magicmouse: Report battery level over USB") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Tested-by: José Expósito <jose.exposito89@gmail.com> Reported-by: <syzbot+a437546ec71b04dfb5ac@syzkaller.appspotmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 0b91b4e commit 33812fc

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/hid/hid-magicmouse.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,7 @@ static int magicmouse_probe(struct hid_device *hdev,
870870

871871
return 0;
872872
err_stop_hw:
873+
del_timer_sync(&msc->battery_timer);
873874
hid_hw_stop(hdev);
874875
return ret;
875876
}

0 commit comments

Comments
 (0)