diff mbox series

[1/2] powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store()

Message ID b46cc4ff-a14c-0c10-0c0c-95573a960178@web.de (mailing list archive)
State Accepted
Headers show
Series PowerPC-pSeries: Adjustments for dlpar_store() | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch next (0e4523c0b4f64eaf7abe59e143e6bdf8f972acff)
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked

Commit Message

Markus Elfring Aug. 27, 2019, 12:42 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 27 Aug 2019 13:34:02 +0200

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>
---
 arch/powerpc/platforms/pseries/dlpar.c | 1 -
 1 file changed, 1 deletion(-)

--
2.23.0

Comments

Nathan Lynch Aug. 27, 2019, 2:26 p.m. UTC | #1
Markus Elfring <Markus.Elfring@web.de> writes:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 27 Aug 2019 13:34:02 +0200
>
> 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>
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 16e86ba8aa20..2a783dc0cfa7 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -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;
 	}