From 2dbf635ea1c0b62a957438d72a162175680a3d4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Wed, 8 Apr 2015 22:56:45 +0200 Subject: [PATCH] HID: hid-lg: Check return values from lg[N]ff_init() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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ý Signed-off-by: Jiri Kosina --- drivers/hid/hid-lg.c | 11 +++++++---- 1 file 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: -- 2.30.2