linux-6.14/arch/arm64/lib/crc-t10dif-glue.c bug report

Eric Biggers ebiggers at kernel.org
Wed Mar 26 13:11:59 PDT 2025


On Wed, Mar 26, 2025 at 07:12:00PM +0000, David Binderman wrote:
> Hello there,
> 
> Static analyser cppcheck says:
> 
>  linux-6.14/arch/arm64/lib/crc-t10dif-glue.c:53:33: error: Using pointer to local variable 'buf' that is out of scope. [invalidLifetime]
> 
> Source code is
> 
>     return crc_t10dif_generic(crc, data, length);
> 
> but this line
> 
>             data = buf;
> 
> looks very suspicious. Suggest move local variable buf out
> to file scope.
> 
> Regards
> 
> David Binderman

Thanks for finding this!  Kind of a silly bug, but that's what we get for
programming in C...
https://lore.kernel.org/r/20250326200812.125574-1-ebiggers@kernel.org and
https://lore.kernel.org/r/20250326200918.125743-1-ebiggers@kernel.org fix this
for arm and arm64.

- Eric



More information about the linux-arm-kernel mailing list