All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linuxppc-dev@lists.ozlabs.org,
	Allison Randal <allison@lohutok.net>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Frank Rowand <frank.rowand@sony.com>,
	Gen Zhang <blackgod016574@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nathan Fontenot <nfont@linux.vnet.ibm.com>,
	Nathan Lynch <nathanl@linux.ibm.com>,
	Oliver O'Halloran <oohall@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/2] powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store()
Date: Tue, 27 Aug 2019 14:42:27 +0200	[thread overview]
Message-ID: <b46cc4ff-a14c-0c10-0c0c-95573a960178@web.de> (raw)
In-Reply-To: <db28c84d-ac07-6d9a-a371-c97ab72bf763@web.de>

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


WARNING: multiple messages have this Message-ID (diff)
From: Markus Elfring <Markus.Elfring@web.de>
To: linuxppc-dev@lists.ozlabs.org,
	Allison Randal <allison@lohutok.net>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Frank Rowand <frank.rowand@sony.com>,
	Gen Zhang <blackgod016574@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nathan Fontenot <nfont@linux.vnet.ibm.com>,
	Nathan Lynch <nathanl@linux.ibm.com>,
	Oliver O'Halloran <oohall@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store()
Date: Tue, 27 Aug 2019 12:42:27 +0000	[thread overview]
Message-ID: <b46cc4ff-a14c-0c10-0c0c-95573a960178@web.de> (raw)
In-Reply-To: <db28c84d-ac07-6d9a-a371-c97ab72bf763@web.de>

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

WARNING: multiple messages have this Message-ID (diff)
From: Markus Elfring <Markus.Elfring@web.de>
To: linuxppc-dev@lists.ozlabs.org,
	Allison Randal <allison@lohutok.net>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Frank Rowand <frank.rowand@sony.com>,
	Gen Zhang <blackgod016574@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nathan Fontenot <nfont@linux.vnet.ibm.com>,
	Nathan Lynch <nathanl@linux.ibm.com>,
	Oliver O'Halloran <oohall@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store()
Date: Tue, 27 Aug 2019 14:42:27 +0200	[thread overview]
Message-ID: <b46cc4ff-a14c-0c10-0c0c-95573a960178@web.de> (raw)
In-Reply-To: <db28c84d-ac07-6d9a-a371-c97ab72bf763@web.de>

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


  reply	other threads:[~2019-08-27 12:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 12:40 [PATCH 0/2] PowerPC-pSeries: Adjustments for dlpar_store() Markus Elfring
2019-08-27 12:40 ` Markus Elfring
2019-08-27 12:40 ` Markus Elfring
2019-08-27 12:42 ` Markus Elfring [this message]
2019-08-27 12:42   ` [PATCH 1/2] powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store() Markus Elfring
2019-08-27 12:42   ` Markus Elfring
2019-08-27 14:26   ` Nathan Lynch
2019-08-27 14:26     ` Nathan Lynch
2019-08-27 14:26     ` Nathan Lynch
2019-08-27 12:44 ` [PATCH 2/2] powerpc/pseries: Delete an error message for a failed string duplication " Markus Elfring
2019-08-27 12:44   ` Markus Elfring
2019-08-27 12:44   ` [PATCH 2/2] powerpc/pseries: Delete an error message for a failed string duplication in dlpar_store( Markus Elfring
2019-08-27 14:27   ` [PATCH 2/2] powerpc/pseries: Delete an error message for a failed string duplication in dlpar_store() Nathan Lynch
2019-08-27 14:27     ` Nathan Lynch
2019-08-27 14:27     ` [PATCH 2/2] powerpc/pseries: Delete an error message for a failed string duplication in dlpar_st Nathan Lynch
2021-02-03 11:40 ` [PATCH 0/2] PowerPC-pSeries: Adjustments for dlpar_store() Michael Ellerman
2021-02-03 11:40   ` Michael Ellerman
2021-02-03 11:40   ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b46cc4ff-a14c-0c10-0c0c-95573a960178@web.de \
    --to=markus.elfring@web.de \
    --cc=allison@lohutok.net \
    --cc=benh@kernel.crashing.org \
    --cc=blackgod016574@gmail.com \
    --cc=frank.rowand@sony.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nathanl@linux.ibm.com \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=oohall@gmail.com \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.