Browse Source

HID: emsff: properly handle emsff_init failure

emsff_init() may fail, let's properly handle the failure.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Axel Lin 14 years ago
parent
commit
2dcd9543a2
1 changed files with 6 additions and 1 deletions
  1. 6 1
      drivers/hid/hid-emsff.c

+ 6 - 1
drivers/hid/hid-emsff.c

@@ -126,7 +126,12 @@ static int ems_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		goto err;
 	}
 
-	emsff_init(hdev);
+	ret = emsff_init(hdev);
+	if (ret) {
+		dev_err(&hdev->dev, "force feedback init failed\n");
+		hid_hw_stop(hdev);
+		goto err;
+	}
 
 	return 0;
 err: