All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Korotkov <korotkov.maxim.s@gmail.com>
To: Armin Wolf <W_Armin@gmx.de>,
	Kenneth Chan <kenneth.t.chan@gmail.com>,
	Kuppuswamy Sathyanarayanan
	<sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: 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,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: panasonic-laptop: fix NULL dereference
Date: Fri, 29 Mar 2024 11:20:49 +0300	[thread overview]
Message-ID: <9c4cfaf8-7738-4ba8-951e-5b91a3414f37@gmail.com> (raw)
In-Reply-To: <da442a04-9db8-4951-98b4-3e149ea06415@gmx.de>

Hi,
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.
> 
> Hi,
> 
> 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().
> 
> Thanks,
> Armin Wolf

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.

Best regards, Max

  reply	other threads:[~2024-03-29  8:20 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 [this message]
2024-03-29 18:44     ` Kuppuswamy Sathyanarayanan
2024-04-02 12:36     ` 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=9c4cfaf8-7738-4ba8-951e-5b91a3414f37@gmail.com \
    --to=korotkov.maxim.s@gmail.com \
    --cc=W_Armin@gmx.de \
    --cc=hmh@hmh.eng.br \
    --cc=i.kapranov@securitycode.ru \
    --cc=kenneth.t.chan@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.