Jelajahi Sumber

HID: zydacron: kfree() NULL pointer cleanup

Checking for NULL pointers before kfree() is redundant.

Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Bojan Prtvar 14 tahun lalu
induk
melakukan
6371fe54b5
1 mengubah file dengan 1 tambahan dan 3 penghapusan
  1. 1 3
      drivers/hid/hid-zydacron.c

+ 1 - 3
drivers/hid/hid-zydacron.c

@@ -201,9 +201,7 @@ static void zc_remove(struct hid_device *hdev)
 	struct zc_device *zc = hid_get_drvdata(hdev);
 	struct zc_device *zc = hid_get_drvdata(hdev);
 
 
 	hid_hw_stop(hdev);
 	hid_hw_stop(hdev);
-
-	if (NULL != zc)
-		kfree(zc);
+	kfree(zc);
 }
 }
 
 
 static const struct hid_device_id zc_devices[] = {
 static const struct hid_device_id zc_devices[] = {