Commit 2dbf635e authored by Michal Malý's avatar Michal Malý Committed by Jiri Kosina

HID: hid-lg: Check return values from lg[N]ff_init()

Check return values from lg[N]ff_init(). hid-lg did not check return values from
the lg[N]_init() functions, possibly trying to work with a device whose
initialization has failed.
Signed-off-by: default avatarMichal Malý <madcatxster@devoid-pointer.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 9c2a6bd1
......@@ -713,13 +713,16 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
}
if (drv_data->quirks & LG_FF)
lgff_init(hdev);
ret = lgff_init(hdev);
if (drv_data->quirks & LG_FF2)
lg2ff_init(hdev);
ret = lg2ff_init(hdev);
if (drv_data->quirks & LG_FF3)
lg3ff_init(hdev);
ret = lg3ff_init(hdev);
if (drv_data->quirks & LG_FF4)
lg4ff_init(hdev);
ret = lg4ff_init(hdev);
if (ret)
goto err_free;
return 0;
err_free:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment