The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	driver-core@lists.linux.dev
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Lyude Paul" <lyude@redhat.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Zijun Hu" <quic_zijuhu@quicinc.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] driver core: faux: Move a variable assignment behind a condition check in faux_device_destroy()
Date: Sun, 12 Jul 2026 18:23:47 +0200	[thread overview]
Message-ID: <d96e797a-2d06-42e0-a3de-972b4f71a5ef@web.de> (raw)
In-Reply-To: <2026071217-fruit-uphill-eb0d@gregkh>

>> The address of a data structure member was determined before
>> a corresponding null pointer check in the implementation of
>> the function “faux_device_destroy”.
>>
>> Thus avoid the risk for undefined behaviour by moving the assignment
>> for the variable “dev” behind a condition check.
> 
> There is no such "undefined behavior" here, sorry, please fix your tools.

Please take another look at related information sources.

EXP34-C: Do not dereference null pointers
https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/expressions-exp/exp34-c/


See also:
https://lore.kernel.org/kernel-janitors/d7a8e34b-e490-47fc-b892-886e1c799c4f@web.de/
https://lkml.org/lkml/2026/7/2/2241

Regards,
Markus

  reply	other threads:[~2026-07-12 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12 13:56 [PATCH] driver core: faux: Move a variable assignment behind a condition check in faux_device_destroy() Markus Elfring
2026-07-12 14:09 ` Greg Kroah-Hartman
2026-07-12 16:23   ` Markus Elfring [this message]
2026-07-12 16:39     ` Greg Kroah-Hartman
2026-07-12 16:54       ` Markus Elfring
2026-07-13  4:44         ` Greg Kroah-Hartman

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=d96e797a-2d06-42e0-a3de-972b4f71a5ef@web.de \
    --to=markus.elfring@web.de \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=quic_zijuhu@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /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