lkml.org 
[lkml]   [2019]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/2] powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store()
From
Date
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(-)

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;
}

--
2.23.0
\
 
 \ /
  Last update: 2019-08-27 14:43    [W:0.050 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site