提交 2dcd9543 编写于 作者: A Axel Lin 提交者: Jiri Kosina

HID: emsff: properly handle emsff_init failure

emsff_init() may fail, let's properly handle the failure.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 b30d89d1
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册