[cocci] Checking data structure member accesses after function return value assignments?

Markus Elfring <[email protected]>
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
Hello,

Felix Gu pointed also another software correction out.

[PATCH] regulator: fp9931: Add missing memory allocation check
https://lore.kernel.org/lkml/[email protected]/
https://lkml.org/lkml/2026/1/18/129


Such an update candidate can be found also by the following tiny SmPL script.
https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/regulator/fp9931.c#L441-L442

@display@
expression action, action2, pointer;
identifier member;
@@
*pointer = action(...);
*pointer->member = action2(...);


May I expect that the same data processing result can be achieved together with
the application of an SmPL nest construct?

@display@
expression action, pointer;
identifier member;
@@
*pointer = action(...);
*<+... pointer->member ...+>
 ;


Regards,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.