From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Maxim Korotkov <korotkov.maxim.s@gmail.com>
Cc: Armin Wolf <W_Armin@gmx.de>,
Kenneth Chan <kenneth.t.chan@gmail.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>,
Len Brown <len.brown@intel.com>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Harald Welte <laforge@gnumonks.org>,
Matthew Garrett <mjg@redhat.com>,
Ivan Kapranov <i.kapranov@securitycode.ru>,
lvc-project@linuxtesting.org,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] platform/x86: panasonic-laptop: fix NULL dereference
Date: Tue, 2 Apr 2024 15:36:21 +0300 (EEST) [thread overview]
Message-ID: <ab04ebea-235b-e3ec-5982-e1f7907bcc64@linux.intel.com> (raw)
In-Reply-To: <9c4cfaf8-7738-4ba8-951e-5b91a3414f37@gmail.com>
On Fri, 29 Mar 2024, Maxim Korotkov wrote:
> On 29.03.2024 03:21, Armin Wolf wrote:
> > > Added a pointer check to ensure that it is valid
> > > before using it for pcc initialization.
> >
> > is this check even needed? I think the ACPI driver core takes care
> > of passing a valid ACPI device pointer to acpi_pcc_hotkey_remove().
>
> I proceeded from the assumption that the current check was not redundant.
> Kuppuswamy correctly noted in the message that the device would most likely be
> valid for the function of removal.
>
> However, in my opinion, checking for NULL is a good coding practice, and has
> now been implemented incorrectly in this case.
>
> Eliminating NULL checks could potentially cause bugs in this context.
Hi,
If you're going to be submitting patches based on some automated tool
which finds "bugs" in kernel, you need to be ready to go through the hoops
of the review process and not just assume the patches are good as is.
We do not do pointless NULL checks in the kernel, this is not a matter of
opinion. If there are unnecessary NULL checks, they should to be
eventually removed (and definitely not used as an excuse to add more).
If the NULL check is not required as was implied to you by the reviewers,
the correct response is to go check that the what the reviewers pointed
out is true and _adapt_ the patch based on that. Then send a v2 of the
patch. It how the kernel development process works. You might sometimes
find the reviewers are wrong too, if that happens you can come back and
point out why the patch is correct.
Either removing that check adds a bug or it doesn't. Not "potentially"
which is just an excuse for not wanting to figure it out from the code.
It takes time and significant effort, I know, but spending time is
required if you want to participate in the kernel development.
--
i.
prev parent reply other threads:[~2024-04-02 12:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 10:35 [PATCH] platform/x86: panasonic-laptop: fix NULL dereference Maxim Korotkov
2024-03-28 21:53 ` Kuppuswamy Sathyanarayanan
2024-03-29 0:21 ` Armin Wolf
2024-03-29 8:20 ` Maxim Korotkov
2024-03-29 18:44 ` Kuppuswamy Sathyanarayanan
2024-04-02 12:36 ` Ilpo Järvinen [this message]
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=ab04ebea-235b-e3ec-5982-e1f7907bcc64@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=W_Armin@gmx.de \
--cc=hmh@hmh.eng.br \
--cc=i.kapranov@securitycode.ru \
--cc=kenneth.t.chan@gmail.com \
--cc=korotkov.maxim.s@gmail.com \
--cc=laforge@gnumonks.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=mjg@redhat.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=sathyanarayanan.kuppuswamy@linux.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 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.