mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] Detecting unchecked return values (with SmPL)?
@ 2026-11-30 13:00 Markus Elfring
  2026-11-30 13:05 ` Julia Lawall
  2026-11-30 16:44 ` Markus Elfring
  0 siblings, 2 replies; 8+ messages in thread
From: Markus Elfring @ 2026-11-30 13:00 UTC (permalink / raw)
  To: cocci, tools, kernel-janitors; +Cc: LKML

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

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

end of thread, other threads:[~2026-11-30 16:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30 13:00 [RFC] Detecting unchecked return values (with SmPL)? Markus Elfring
2026-11-30 13:05 ` Julia Lawall
2026-11-30 13:25   ` [cocci] " Markus Elfring
2026-11-30 13:52     ` Julia Lawall
2026-11-30 14:00   ` Markus Elfring
2026-11-30 15:49     ` Julia Lawall
2026-11-30 15:58       ` Markus Elfring
2026-11-30 16:44 ` Markus Elfring

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

all inboxes | Powered by JetHome®