From: Markus Elfring Date: Tue, 27 Aug 2019 11:34:02 +0000 (+0200) Subject: powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store() X-Git-Tag: v5.12-rc1~78^2~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de060ac83e5c1fe5fb8c505a4e99c1fe4f70ff94;p=thirdparty%2Fkernel%2Flinux.git powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store() 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 Acked-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b46cc4ff-a14c-0c10-0c0c-95573a960178@web.de --- diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 16e86ba8aa209..2a783dc0cfa7c 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; }