From 2dcd9543a28da523a179a13b1eefa5f9b8e05d72 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 19 Jul 2011 16:14:04 +0800 Subject: [PATCH] HID: emsff: properly handle emsff_init failure emsff_init() may fail, let's properly handle the failure. Signed-off-by: Axel Lin Signed-off-by: Jiri Kosina --- drivers/hid/hid-emsff.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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: -- 2.20.1