[PATCH] mtd: parsers: qcom: Fix error condition

Miquel Raynal miquel.raynal at bootlin.com
Thu Mar 11 11:39:28 GMT 2021


On Wed, 2021-03-03 at 08:46:34 UTC, Miquel Raynal wrote:
> qcom_smem_get() does not return NULL, and even if it did, the NULL
> condition is usually not an error but a success condition and should
> not trigger an error trace.
> 
> Let's replace IS_ERR_OR_NULL() by IS_ERR().
> 
> This fixes the following smatch warning:
> drivers/mtd/parsers/qcomsmempart.c:109 parse_qcomsmem_part() warn: passing zero to 'PTR_ERR'
> 
> Reported-by: kernel test robot <lkp at intel.com>
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
> Fixes: 803eb124e1a6 ("mtd: parsers: Add Qcom SMEM parser")
> Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next.

Miquel



More information about the linux-mtd mailing list