Skip to contentSkip to conversation

ARM: OMAP: fix return value check in omap_device_build_from_dt()

PATCH New Wei Yongjun 3 participants 4 messages Jul 4, 2013 – Sep 17, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP: fix return value check in omap_device_build_from_dt()

From: Wei Yongjun <[email protected]>

In case of error, the function omap_device_alloc() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().

---
 arch/arm/mach-omap2/omap_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/omap_device.c +1 -1
index 5cc9287..28e70c0 100644
@@ -155,7 +155,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
 	}
 
 	od = omap_device_alloc(pdev, hwmods, oh_cnt);
-	if (!od) {
+	if (IS_ERR(od)) {
 		dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n",
 			oh_name);
 		ret = PTR_ERR(od);
maintainer
#1 lore raw

PATCH 1/1 ARM: OMAP: fix return value check in omap_device_build_from_dt()

Kevin,

Quoted 5 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

In case of error, the function omap_device_alloc() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().

Looks like this is still pending, care to take this?

Tony

Quoted 19 lines
---
 arch/arm/mach-omap2/omap_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/omap_device.c +1 -1
index 5cc9287..28e70c0 100644
@@ -155,7 +155,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
 	}
 
 	od = omap_device_alloc(pdev, hwmods, oh_cnt);
-	if (!od) {
+	if (IS_ERR(od)) {
 		dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n",
 			oh_name);
 		ret = PTR_ERR(od);
#2 lore raw

PATCH 1/1 ARM: OMAP: fix return value check in omap_device_build_from_dt()

Quoted 10 lines · Tony Lindgren

Kevin,

Quoted 5 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

In case of error, the function omap_device_alloc() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().

Looks like this is still pending, care to take this?

Looks fine to me, since I don't have anything else in the queue, feel free to queue up for fixes-non-critical.

Kevin

maintainer
#3 lore raw

PATCH 1/1 ARM: OMAP: fix return value check in omap_device_build_from_dt()

Quoted 11 lines · Kevin Hilman
Quoted 9 lines · Tony Lindgren

Kevin,

Quoted 5 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

In case of error, the function omap_device_alloc() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().

Quoted 6 lines
Quoted 1 line

Looks like this is still pending, care to take this?

Looks fine to me, since I don't have anything else in the queue, feel free to queue up for fixes-non-critical.

Applying into omap-for-v3.12/fixes thanks.

Tony