aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-07-19 04:14:04 -0400
committerJiri Kosina <jkosina@suse.cz>2011-07-20 05:55:18 -0400
commit2dcd9543a28da523a179a13b1eefa5f9b8e05d72 (patch)
treea11707336226b54ec1f72c3e99a4f953cad1b088 /drivers
parentb30d89d1055f9acd14b5eaf82d8f6a4763e91d85 (diff)
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')
-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)
126 goto err; 126 goto err;
127 } 127 }
128 128
129 emsff_init(hdev); 129 ret = emsff_init(hdev);
130 if (ret) {
131 dev_err(&hdev->dev, "force feedback init failed\n");
132 hid_hw_stop(hdev);
133 goto err;
134 }
130 135
131 return 0; 136 return 0;
132err: 137err: