Commit 32937a82 authored by YueHaibing's avatar YueHaibing Committed by Boris Brezillon

mtd: docg3: Fix passing zero to 'PTR_ERR' warning in doc_probe_device

Fix a static code checker warning:
drivers/mtd/devices/docg3.c:1875
 doc_probe_device() warn: passing zero to 'ERR_PTR'

Fixes: ae9d4934 ("mtd: docg3: add multiple floor support")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarBoris Brezillon <bbrezillon@kernel.org>
parent 2431c4f5
......@@ -1872,7 +1872,7 @@ doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev)
nomem2:
kfree(docg3);
nomem1:
return ERR_PTR(ret);
return ret ? ERR_PTR(ret) : NULL;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment