Commit 8d02c022 authored by Tapasweni Pathak's avatar Tapasweni Pathak Committed by Greg Kroah-Hartman

staging: unisys: visorutil: 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 avatarTapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 029bf138
...@@ -320,19 +320,18 @@ void visor_proc_DestroyObject(MYPROCOBJECT *obj) ...@@ -320,19 +320,18 @@ void visor_proc_DestroyObject(MYPROCOBJECT *obj)
kfree(obj->procDirProperties); kfree(obj->procDirProperties);
obj->procDirProperties = NULL; obj->procDirProperties = NULL;
} }
if (obj->procDirPropertyContexts != NULL) {
kfree(obj->procDirPropertyContexts); kfree(obj->procDirPropertyContexts);
obj->procDirPropertyContexts = NULL; obj->procDirPropertyContexts = NULL;
}
if (obj->procDir != NULL) { if (obj->procDir != NULL) {
if (obj->name != NULL) if (obj->name != NULL)
remove_proc_entry(obj->name, type->procDir); remove_proc_entry(obj->name, type->procDir);
obj->procDir = NULL; obj->procDir = NULL;
} }
if (obj->name != NULL) {
kfree(obj->name); kfree(obj->name);
obj->name = NULL; obj->name = NULL;
}
kfree(obj); kfree(obj);
} }
EXPORT_SYMBOL_GPL(visor_proc_DestroyObject); EXPORT_SYMBOL_GPL(visor_proc_DestroyObject);
......
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