From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: platform-driver-x86@vger.kernel.org,
Hans de Goede <hansg@kernel.org>,
Jorge Lopez <jorge.lopez2@hp.com>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] platform/x86: hp-bioscfg: Use more common code in hp_init_bios_package_attribute()
Date: Wed, 1 Jul 2026 14:53:22 +0300 (EEST) [thread overview]
Message-ID: <1b9c1471-bfc1-4b0c-c303-ed08c5fba4b3@linux.intel.com> (raw)
In-Reply-To: <0b2257be-a509-4c86-94ec-3f23847c9626@web.de>
On Thu, 18 Jun 2026, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 18 Jun 2026 21:42:27 +0200
>
> Use an existing label once more so that a bit of common code can be better
> reused at the end of this function implementation.
>
> This issue was detected by using the Coccinelle software.
This patch leaves me quite unimpressed of Coccinelle's abilities.
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c
> index 27fd6cd21529..819313a4425a 100644
> --- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c
> +++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c
> @@ -692,8 +692,7 @@ static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type,
> if (ret) {
> pr_debug("Failed to populate integer package data. Error [0%0x]\n",
> ret);
> - kfree(str_value);
> - return ret;
> + goto pack_attr_exit;
If a call fails, it's expected to handle cleanup itself --- which is
exactly what hp_convert_hexstr_to_str() appears to be doing (by not
writing into *str until it's committed to returning 0). So why is
this kfree() necessary in the first place?!?
--
i.
next prev parent reply other threads:[~2026-07-01 11:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 19:54 Markus Elfring
2026-07-01 11:53 ` Ilpo Järvinen [this message]
2026-07-01 17:53 ` Markus Elfring
2026-07-03 10:32 ` Ilpo Järvinen
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=1b9c1471-bfc1-4b0c-c303-ed08c5fba4b3@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=Markus.Elfring@web.de \
--cc=hansg@kernel.org \
--cc=jorge.lopez2@hp.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox