[RFC] Detecting missing null pointer checks after memory allocations
From: Markus Elfring
Date: Sat Nov 01 2025 - 08:43:18 EST
Hello,
I got into the mood to try another simple source code search out which
can be achieved also by the means of the semantic patch language.
@display@
expression size, source, target;
@@
target =
(
*kmalloc
|
*vmalloc
|
*malloc
)(...);
memcpy(target, source, size);
It can be determined then from the generated diff file that mentioned
implementation details can be found at 11 places (4 source files) of
the software “Linux next-20251031”.
Will such analysis information trigger further collateral evolution?
Regards,
Markus