[PATCH 1/1] fs/squashfs: parameter check sqfs_read_metablock()

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Sep 23 21:49:41 CEST 2020


On Wed, 23 Sep 2020 21:13:51 +0200
Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:

> We should check if the incoming parameter file_mapping is not NULL instead
> of checking after adding an offset.
> 
> Reported-by: Coverity CID 307210
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>

Acked-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>

However, I wonder if this check is really useful. sqfs_read_metablock()
is an internal function, so it should be up to the callers to make sure
that they don't pass a NULL file_mapping argument.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the U-Boot mailing list