public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr
Subject: [cocci] Searching for missing cleanup function calls (with SmPL)?
Date: Thu, 4 Sep 2025 14:36:57 +0200	[thread overview]
Message-ID: <6c2e0db1-033f-4f66-9cf7-dc0eae4bcde7@web.de> (raw)

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

             reply	other threads:[~2025-09-04 12:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 12:36 Markus Elfring [this message]
2025-09-04 12:43 ` [cocci] Searching for missing cleanup function calls (with SmPL)? 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

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=6c2e0db1-033f-4f66-9cf7-dc0eae4bcde7@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    /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