[PATCH] fs: erofs: Do NULL check before dereferencing pointer

Gao Xiang xiang at kernel.org
Fri Jul 4 21:25:26 AEST 2025


On Fri, Jul 04, 2025 at 11:53:18AM +0100, Andrew Goodbody wrote:
> The assignments to sect and off use the pointer from ctxt.cur_dev but
> that has not been NULL checked before this is done. So instead move the
> assignments after the NULL check.
> 
> This issue found by Smatch
> 
> Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>

Reviewed-by: Gao Xiang <xiang at kernel.org>

Thanks!
Gao Xiang


More information about the Linux-erofs mailing list