Commit 7f4eec39 authored by Markus Elfring's avatar Markus Elfring Committed by Michael Ellerman

powerpc: Delete unnecessary checks before kfree()

The kfree() function tests whether its argument is NULL and then returns
immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 7e73a3b7
...@@ -284,7 +284,7 @@ EXPORT_SYMBOL_GPL(rh_create); ...@@ -284,7 +284,7 @@ EXPORT_SYMBOL_GPL(rh_create);
*/ */
void rh_destroy(rh_info_t * info) void rh_destroy(rh_info_t * info)
{ {
if ((info->flags & RHIF_STATIC_BLOCK) == 0 && info->block != NULL) if ((info->flags & RHIF_STATIC_BLOCK) == 0)
kfree(info->block); kfree(info->block);
if ((info->flags & RHIF_STATIC_INFO) == 0) if ((info->flags & RHIF_STATIC_INFO) == 0)
......
...@@ -393,11 +393,10 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node, ...@@ -393,11 +393,10 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node,
error: error:
if (mem_init_done) { if (mem_init_done) {
if (config && *config) if (config)
kfree(*config); kfree(*config);
if (res && *res) if (res)
kfree(*res); kfree(*res);
} else { } else {
if (config && *config) { if (config && *config) {
size = 256; size = 256;
......
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