]> git.karo-electronics.de Git - linux-beck.git/commitdiff
HID: emsff: properly handle emsff_init failure
authorAxel Lin <axel.lin@gmail.com>
Tue, 19 Jul 2011 08:14:04 +0000 (16:14 +0800)
committerJiri Kosina <jkosina@suse.cz>
Wed, 20 Jul 2011 09:55:18 +0000 (11:55 +0200)
emsff_init() may fail, let's properly handle the failure.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-emsff.c

index 81877c67caea5891d71d526094978aa607b3d508..a5dc13fe367b7584e8290e1e5dcd29c5cd028df7 100644 (file)
@@ -126,7 +126,12 @@ static int ems_probe(struct hid_device *hdev, const struct hid_device_id *id)
                goto err;
        }
 
-       emsff_init(hdev);
+       ret = emsff_init(hdev);
+       if (ret) {
+               dev_err(&hdev->dev, "force feedback init failed\n");
+               hid_hw_stop(hdev);
+               goto err;
+       }
 
        return 0;
 err: