Skip to contentSkip to conversation

omap: device: improve errors handling

PATCH In review Artem Bityutskiy 3 participants 4 messages Jul 12, 2010 – Aug 4, 2010

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

PATCH 1/1 omap: device: improve errors handling

From: Artem Bityutskiy <[email protected]>

Do not forget to check the 'platform_device_add_data()' error code in 'omap_device_build_ss()'.

---
 arch/arm/plat-omap/omap_device.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/plat-omap/omap_device.c +3 -1
index ea0d659..d2b1609 100644
@@ -407,7 +407,9 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
 	od->pdev.num_resources = res_count;
 	od->pdev.resource = res;
 
-	platform_device_add_data(&od->pdev, pdata, pdata_len);
+	ret = platform_device_add_data(&od->pdev, pdata, pdata_len);
+	if (ret)
+		goto odbs_exit4;
 
 	od->pm_lats = pm_lats;
 	od->pm_lats_cnt = pm_lats_cnt;
Signature · 1 line
1.7.1.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Artem Bityutskiy

From: Artem Bityutskiy <[email protected]>

Do not forget to check the 'platform_device_add_data()' error code in 'omap_device_build_ss()'.

Looks fine to me, platform_device_add_data() can return -ENOMEM in the unlikely event that its kmemdup() fails.

Quoted 33 lines
---
 arch/arm/plat-omap/omap_device.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/plat-omap/omap_device.c +3 -1
index ea0d659..d2b1609 100644
@@ -407,7 +407,9 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
 	od->pdev.num_resources = res_count;
 	od->pdev.resource = res;
 
-	platform_device_add_data(&od->pdev, pdata, pdata_len);
+	ret = platform_device_add_data(&od->pdev, pdata, pdata_len);
+	if (ret)
+		goto odbs_exit4;
 
 	od->pm_lats = pm_lats;
 	od->pm_lats_cnt = pm_lats_cnt;
Signature · 9 lines
1.7.1.1




--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

- Paul

#2 lore raw

Tony,

by the way,

Quoted 11 lines · Paul Walmsley
Quoted 4 lines · Artem Bityutskiy

From: Artem Bityutskiy <[email protected]>

Do not forget to check the 'platform_device_add_data()' error code in 'omap_device_build_ss()'.

Looks fine to me, platform_device_add_data() can return -ENOMEM in the unlikely event that its kmemdup() fails.

you want to take this one, or want me to queue it up for .37?

- Paul

#3 lore raw
Quoted 13 lines · Paul Walmsley

Tony,

by the way,

Quoted 7 lines · Paul Walmsley
Quoted 4 lines · Artem Bityutskiy

From: Artem Bityutskiy <[email protected]>

Do not forget to check the 'platform_device_add_data()' error code in 'omap_device_build_ss()'.

Quoted 6 lines
Quoted 4 lines

Looks fine to me, platform_device_add_data() can return -ENOMEM in the unlikely event that its kmemdup() fails.

you want to take this one, or want me to queue it up for .37?

Thanks, I'll add it to omap-for-linus for 2.6.36.

Regards,

Tony