mtd: denali: fix error handling for devm_ioremap_nocache()
Subsystems (2)
PATCH RESEND 1/1 mtd: denali: fix error handling for devm_ioremap_nocache()
It is incorrect to use !res' for error handling since res' must be non-null. Use the return value `ptr' instead.
Signed-off-by Xi Wang <[email protected]>
--- drivers/mtd/nand/denali_dt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/denali_dt.c +1 -1
@@ -42,7 +42,7 @@ static void __iomem *request_and_map(struct device *dev, } ptr =devm_ioremap_nocache (dev, res->start,resource_size (res)); -if (!res) +if (!ptr)dev_err (dev,"ioremap_nocache of %s failed!" , res->name);return ptr;
Signature · 1 line
1.8.1.2
Quoted 5 lines · Xi Wang
It is incorrect to use
!res' for error handling sinceres' must be non-null. Use the return value `ptr' instead.Signed-off-by Xi Wang <[email protected]>---
This is already fixed upstream:
commit 6c67050ab108bcce2576fa1d7a0557eb0376520a
Author: Sachin Kamat <[email protected]> Date: Mon Mar 18 15:11:11 2013 +0530
mtd: denali_dt: Fix incorrect error check
The return value of devm_ioremap_nocache should be checked here
instead
of res.
Signed-off-by Sachin Kamat <[email protected]>
Signed-off-by Artem Bityutskiy <[email protected]>
Signed-off-by David Woodhouse <[email protected]>
Signature · 2 lines
Best Regards, Artem Bityutskiy