The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr, tools@kernel.org, kernel-janitors@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [RFC] Detecting unchecked return values (with SmPL)?
Date: Mon, 30 Nov 2026 14:00:11 +0100	[thread overview]
Message-ID: <214cdbae-b798-4ea4-8c1e-9eabdfd1663a@web.de> (raw)

Hello,

Macro and function calls for which a return value is not assigned to a variable
can be found also by a script (like the following) for the semantic patch language.

@display@
identifier i;
statement s;
@@
(
*i(...);
&s
)


Some developers and software reviewers care for a corresponding topic.

CWE-252: Unchecked Return Value
https://cwe.mitre.org/data/definitions/252.html


Thus I suggest to refine case distinctions accordingly.

1. Identifiers can eventually be excluded if they would denote items
   with the return type “void”.

2. Identifiers can eventually be restricted to names that would denote items
   according to non-void return types.


Which structures would you choose for such data processing purposes?

Regards,
Markus

             reply	other threads:[~2026-11-30 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 13:00 Markus Elfring [this message]
2026-11-30 13:05 ` [RFC] Detecting unchecked return values (with SmPL)? Julia Lawall
2026-11-30 13:25   ` [cocci] " 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=214cdbae-b798-4ea4-8c1e-9eabdfd1663a@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tools@kernel.org \
    /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