[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1299994157-11191-22-git-send-email-imirkin@alum.mit.edu>
Date: Sun, 13 Mar 2011 00:29:14 -0500
From: Ilia Mirkin <imirkin@...m.mit.edu>
To: Greg Kroah-Hartman <gregkh@...e.de>
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 21/24] staging: vt6655: Remove NULL check before kfree
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>
Signed-off-by: Ilia Mirkin <imirkin@...m.mit.edu>
---
drivers/staging/vt6655/device_main.c | 3 +--
drivers/staging/vt6655/hostap.c | 3 +--
drivers/staging/vt6655/wpactl.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 638e391..efaf19b 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -3064,8 +3064,7 @@ else {
}
error1:
- if(buffer)
- kfree(buffer);
+ kfree(buffer);
if(filp_close(filp,NULL))
printk("Config_FileOperation:close file fail\n");
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
index 5b83f94..7735027 100644
--- a/drivers/staging/vt6655/hostap.c
+++ b/drivers/staging/vt6655/hostap.c
@@ -860,8 +860,7 @@ int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p)
}
out:
- if (param != NULL)
- kfree(param);
+ kfree(param);
return ret;
}
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index 4bdb836..fbae16d 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -987,8 +987,7 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p)
}
out:
- if (param != NULL)
- kfree(param);
+ kfree(param);
return ret;
}
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists