mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	"Hans de Goede" <hansg@kernel.org>,
	"Jorge Lopez" <jorge.lopez2@hp.com>
Cc: 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 19:53:54 +0200	[thread overview]
Message-ID: <b81acc89-c91f-46d9-b6de-5367b6cf94f4@web.de> (raw)
In-Reply-To: <1b9c1471-bfc1-4b0c-c303-ed08c5fba4b3@linux.intel.com>

>> 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.

The intention of this development tool is not to impress you with a possible
source code transformation.


…
>> +++ 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;

Another source code search approach pointed implementation details out
for further development considerations.


> 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?!?
Would any contributors like to adjust background information accordingly?

Regards,
Markus

  reply	other threads:[~2026-07-01 17:54 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
2026-07-01 17:53   ` Markus Elfring [this message]
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=b81acc89-c91f-46d9-b6de-5367b6cf94f4@web.de \
    --to=markus.elfring@web.de \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --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