summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorMichal Malý <madcatxster@devoid-pointer.net>2015-04-08 23:56:45 +0300
committerJiri Kosina <jkosina@suse.cz>2015-05-07 17:27:09 +0300
commit2dbf635ea1c0b62a957438d72a162175680a3d4a (patch)
treeb6b5c7c86868508af0f9c2fe82d8d4bf6417d569 /drivers/hid
parent9c2a6bd1133f7eae42b7b4e245d2aafecaf4a082 (diff)
downloadlinux-2dbf635ea1c0b62a957438d72a162175680a3d4a.tar.xz
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>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-lg.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index 2671de952e62..3f01da695d5e 100644
--- a/drivers/hid/hid-lg.c
+++ b/drivers/hid/hid-lg.c
@@ -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: