Commit 794a8946 authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Greg Kroah-Hartman

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: default avatarIlia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 06dde506
...@@ -516,7 +516,6 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image, ...@@ -516,7 +516,6 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
if (existing_size != 0) { if (existing_size != 0) {
iounmap(image->kern_base); iounmap(image->kern_base);
image->kern_base = NULL; 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); release_resource(&image->bus_resource);
memset(&image->bus_resource, 0, sizeof(struct resource)); memset(&image->bus_resource, 0, sizeof(struct resource));
......
...@@ -821,7 +821,6 @@ static int tsi148_alloc_resource(struct vme_master_resource *image, ...@@ -821,7 +821,6 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
if (existing_size != 0) { if (existing_size != 0) {
iounmap(image->kern_base); iounmap(image->kern_base);
image->kern_base = NULL; 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); release_resource(&image->bus_resource);
memset(&image->bus_resource, 0, sizeof(struct resource)); memset(&image->bus_resource, 0, sizeof(struct resource));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment