From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
Tony Luck <tony.luck@intel.com>,
Zhang Yanmin <yanmin.zhang@intel.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-ia64@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/2] ia64: topology: Fix an error handling path in cache_add_dev()
Date: Mon, 28 Mar 2022 19:45:14 +0000 [thread overview]
Message-ID: <78d00a13-3cee-386c-07f1-8d16a24e4e67@wanadoo.fr> (raw)
In-Reply-To: <facd6471-4c4f-ff5a-e81f-38acd855eb8d@physik.fu-berlin.de>
Le 28/03/2022 à 21:16, John Paul Adrian Glaubitz a écrit :
> Hi Christophe!
>
> On 3/28/22 21:07, Christophe JAILLET wrote:
>> If kobject_init_and_add()fails, kobject_put() needs to be called.
>> Add the missing call which is already there a few lines below in another
>> error handling path.
>>
>> Fixes: f19180056ea0 ("[IA64] Export cpu cache info by sysfs")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> Thanks for your patches. There is currently no maintainer for ia64, so the patches
> would have to go through Andrew Morton's tree.
>
> However, I can test the patches and verify they don't break anything.
>
> Adrian
>
Hi,
digging deeper for other potential same issues in other file, I don't
think that this patch is needed, and I don't think that it fixes anything.
The "name" of this kobject is "%s", "cache".
So nothing needs to be freed for that because kstrdup_const() will be used.
This kobject has no .release function.
If the add() part of kobject_init_and_add(), then 'state_in_sysfs' will
still be 0, so nothing needs to be released for that either.
So, adding a kobject_put() would just be a no-op here (if I understand
correctly).
I've been puzzled by the kobject_put() later, but in this case, _add()
has already succeeded and state_in_sysfs=1 and the call is needed.
For the other patch, it is just a clean-up. Based on Wikipedia, IA64 is
discontinued, so such clean-up does not make that much sense either.
(on the other hand, it should be eay to review and apply :) )
I don't think you need to spent time on it. Sorry for the noise.
CJ
next prev parent reply other threads:[~2022-03-28 19:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 19:07 [PATCH 1/2] ia64: topology: Fix an error handling path in cache_add_dev() Christophe JAILLET
2022-03-28 19:07 ` [PATCH 2/2] ia64: topology: Slightly simplify code Christophe JAILLET
2022-03-28 19:16 ` [PATCH 1/2] ia64: topology: Fix an error handling path in cache_add_dev() John Paul Adrian Glaubitz
2022-03-28 19:45 ` Christophe JAILLET [this message]
2022-03-28 20:07 ` John Paul Adrian Glaubitz
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=78d00a13-3cee-386c-07f1-8d16a24e4e67@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=akpm@linux-foundation.org \
--cc=glaubitz@physik.fu-berlin.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=yanmin.zhang@intel.com \
/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