public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
* [cocci] Searching for missing cleanup function calls (with SmPL)?
@ 2025-09-04 12:36 Markus Elfring
  2025-09-04 12:43 ` Julia Lawall
  2025-09-06  8:00 ` [cocci] Searching for selected variable assignments " Markus Elfring
  0 siblings, 2 replies; 25+ messages in thread
From: Markus Elfring @ 2025-09-04 12:36 UTC (permalink / raw)
  To: cocci

Hello,

I tried the following script out for the semantic patch language.


@display@
expression e;
statement s;
struct device_node * dn;
@@
*dn = e(...);
 if (!dn)
    s
 ... when != dn


It can be determined then that the software “Linux next-20250904” contains
80 variable assignments where the object address might not be used any more
after a null pointer check.

* Would you be looking for corresponding improvements of such a source code
  search approach?

* How do you think about to take further data structures into account
  for which objects should usually be released by a cleanup function?
  Can the search pattern become more generic and safer?


Regards,
Markus

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2025-09-12 15:43 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04 12:36 [cocci] Searching for missing cleanup function calls (with SmPL)? Markus Elfring
2025-09-04 12:43 ` Julia Lawall
2025-09-04 12:58   ` Markus Elfring
2025-09-12  9:29   ` Markus Elfring
2025-09-12 11:07     ` Julia Lawall
2025-09-12 12:30       ` Markus Elfring
2025-09-12 13:43     ` Markus Elfring
2025-09-12 15:43   ` Markus Elfring
2025-09-06  8:00 ` [cocci] Searching for selected variable assignments " Markus Elfring
2025-09-06  8:07   ` Julia Lawall
2025-09-06  8:10     ` Markus Elfring
2025-09-06  8:22       ` Julia Lawall
2025-09-06  9:11         ` Markus Elfring
2025-09-06  9:14           ` Julia Lawall
2025-09-06  9:28             ` Markus Elfring
2025-09-06 10:25               ` Markus Elfring
2025-09-06 11:12                 ` Julia Lawall
2025-09-06 12:07                   ` Markus Elfring
2025-09-06 12:13                     ` Julia Lawall
2025-09-06 12:30                       ` Markus Elfring
2025-09-06 12:36                         ` Julia Lawall
2025-09-06 12:47                           ` Markus Elfring
2025-09-06 12:51                             ` Julia Lawall
2025-09-06 13:20     ` Markus Elfring
2025-09-08  6:15       ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox