Re: fbdev: arkfb: Move a variable assignment behind a condition check in ics5342_init()

Markus Elfring <[email protected]> Mon, 20 Jul 2026 11:52:24 +0200
Newsgroups org.kernel.vger.kernel-janitors,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-fbdev,org.kernel.vger.linux-hardening,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 =E2=80=9Cics5342_init=E2=80=9D.
>>>>
>>>> Thus avoid the risk for undefined behaviour by moving the assignment
>>>> for the variable =E2=80=9Cinfo=E2=80=9D behind a condition check.
>>>>
>>>> This issue was detected by using the Coccinelle software.
>>>
>>> There is no "risk" here.
>>> It just adds an offset to a potential NULL value (which isn't then use=
d afterwards).
>> Does your understanding of programming language details differ from the=
 view of
>> SEI CERT C Coding Standard (from the Carnegie Mellon University)?
>> https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-sta=
ndard/rules/expressions-exp/exp34-c/
> My statement still stands.
> Try to find the difference between the code and the examples on that web=
site yourself.
> Tip: The relevant part is the "&" and in doubt look at the generated ass=
embly code.
Do any more code reviewers take another look at results from undefined beh=
aviour sanitizers?

* https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#introduction

* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/=
Documentation/dev-tools/ubsan.rst?h=3Dv7.2-rc3#n6


See also:
https://stackoverflow.com/questions/79662603/why-do-compilers-not-warn-abo=
ut-this-null-dereferencing-even-when-they-detect-i#answer-79663272

Regards,
Markus