From: Axel Lin Date: Tue, 19 Jul 2011 08:14:04 +0000 (+0800) Subject: HID: emsff: properly handle emsff_init failure X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2dcd9543a28da523a179a13b1eefa5f9b8e05d72;p=linux-beck.git 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 --- 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: