summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-emsff.c
diff options
context:
space:
mode:
authorAxel Lin2011-07-19 10:14:04 +0200
committerJiri Kosina2011-07-20 11:55:18 +0200
commit2dcd9543a28da523a179a13b1eefa5f9b8e05d72 (patch)
treea11707336226b54ec1f72c3e99a4f953cad1b088 /drivers/hid/hid-emsff.c
parentHID: ACRUX - add missing hid_hw_stop() in ax_probe() error path (diff)
downloadkernel-qcow2-linux-2dcd9543a28da523a179a13b1eefa5f9b8e05d72.tar.gz
kernel-qcow2-linux-2dcd9543a28da523a179a13b1eefa5f9b8e05d72.tar.xz
kernel-qcow2-linux-2dcd9543a28da523a179a13b1eefa5f9b8e05d72.zip
HID: emsff: properly handle emsff_init failure
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>
Diffstat (limited to 'drivers/hid/hid-emsff.c')
-rw-r--r--drivers/hid/hid-emsff.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c
index 81877c67caea..a5dc13fe367b 100644
--- a/drivers/hid/hid-emsff.c
+++ b/drivers/hid/hid-emsff.c
@@ -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: