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