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: Michal Malý <madcatxster@devoid-pointer.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Michal Malý 2015-04-08 22:56:45 +02:00 committed by Jiri Kosina
parent 9c2a6bd113
commit 2dbf635ea1

View File

@ -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: