HID: kfree() NULL pointer cleanup
Subsystems (2)
PATCH 2/2 HID: kfree() NULL pointer cleanup
Checking for NULL pointers before kfree() is redundant.
Signed-off-by Bojan Prtvar <[email protected]>
--- drivers/hid/hid-zydacron.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/hid/hid-zydacron.c +1 -3
@@ -201,9 +201,7 @@ static void zc_remove(struct hid_device *hdev)struct zc_device *zc =hid_get_drvdata (hdev);hid_hw_stop (hdev); - -if (NULL != zc) -kfree (zc); +kfree (zc); }static const struct hid_device_id zc_devices[] = {
Signature · 1 line
1.7.1
Jiri Kosina
AppliedQuoted 12 lines · Bojan Prtvar
Checking for NULL pointers before
kfree()is redundant.Signed-off-by Bojan Prtvar <[email protected]>--- drivers/hid/hid-zydacron.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)drivers/hid/hid-zydacron.c +0
-0
drivers/hid/hid-zydacron.c static void zc_remove(struct hid_device *hdev) · line 205
Quoted 8 lines
drivers/hid/hid-zydacron.c +1
-3@@ -201,9 +201,7 @@ static void zc_remove(struct hid_device *hdev)struct zc_device *zc =hid_get_drvdata (hdev);hid_hw_stop (hdev); - -if (NULL != zc) -kfree (zc); +kfree (zc); }
Applied, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs