Re: [PATCH] driver core: faux: Move a variable assignment behind a condition check in faux_device_destroy()

Markus Elfring <[email protected]> Sun, 12 Jul 2026 18:23:47 +0200
Newsgroups org.kernel.vger.kernel-janitors,dev.linux.lists.driver-core,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
>> 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/[email protected]/
https://lkml.org/lkml/2026/7/2/2241

Regards,
Markus