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: ae9d4934b2 ("mtd: docg3: add multiple floor support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
This commit is contained in:
YueHaibing 2019-01-23 14:58:27 +08:00 committed by Boris Brezillon
parent 2431c4f5b4
commit 32937a82f3
1 changed files with 1 additions and 1 deletions

View File

@ -1872,7 +1872,7 @@ nomem3:
nomem2:
kfree(docg3);
nomem1:
return ERR_PTR(ret);
return ret ? ERR_PTR(ret) : NULL;
}
/**