mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
staging: vme: 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@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
06dde50620
commit
794a8946ba
2 changed files with 2 additions and 4 deletions
|
|
@ -516,8 +516,7 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
|
|||
if (existing_size != 0) {
|
||||
iounmap(image->kern_base);
|
||||
image->kern_base = NULL;
|
||||
if (image->bus_resource.name != NULL)
|
||||
kfree(image->bus_resource.name);
|
||||
kfree(image->bus_resource.name);
|
||||
release_resource(&image->bus_resource);
|
||||
memset(&image->bus_resource, 0, sizeof(struct resource));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -821,8 +821,7 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
|
|||
if (existing_size != 0) {
|
||||
iounmap(image->kern_base);
|
||||
image->kern_base = NULL;
|
||||
if (image->bus_resource.name != NULL)
|
||||
kfree(image->bus_resource.name);
|
||||
kfree(image->bus_resource.name);
|
||||
release_resource(&image->bus_resource);
|
||||
memset(&image->bus_resource, 0, sizeof(struct resource));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue