Skip to content

Commit

Permalink
powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store()
Browse files Browse the repository at this point in the history
A null pointer would be passed to a call of the function “kfree”
immediately after a call of the function “kstrdup” failed at one place.
Remove this superfluous function call.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b46cc4ff-a14c-0c10-0c0c-95573a960178@web.de
  • Loading branch information
Markus Elfring authored and Michael Ellerman committed Jan 31, 2021
1 parent 245a389 commit de060ac
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion arch/powerpc/platforms/pseries/dlpar.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ static ssize_t dlpar_store(struct class *class, struct class_attribute *attr,
args = argbuf = kstrdup(buf, GFP_KERNEL);
if (!argbuf) {
pr_info("Could not allocate resources for DLPAR operation\n");
kfree(argbuf);
return -ENOMEM;
}

Expand Down

0 comments on commit de060ac

Please sign in to comment.