Skip to contentSkip to conversation

ucb1400_core: avoid calling platform_device_put() twice in ucb1400_core_probe error path

PATCH In review Axel Lin 3 participants 3 messages Aug 3, 2010 Multifunction devices (MFD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ucb1400_core: avoid calling platform_device_put() twice in ucb1400_core_probe error path

In the case of goto err2, what we want is to call platform_device_del() instead of platform_device_unregister(). Otherwise, we call platform_device_put() twice.

---
 drivers/mfd/ucb1400_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/ucb1400_core.c +1 -1
index dbe2801..d73f84b 100644
@@ -114,7 +114,7 @@ static int ucb1400_core_probe(struct device *dev)
 err3:
 	platform_device_put(ucb->ucb1400_ts);
 err2:
-	platform_device_unregister(ucb->ucb1400_gpio);
+	platform_device_del(ucb->ucb1400_gpio);
 err1:
 	platform_device_put(ucb->ucb1400_gpio);
 err0:
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 3 lines · Axel Lin

In the case of goto err2, what we want is to call platform_device_del() instead of platform_device_unregister(). Otherwise, we call platform_device_put() twice.

Patch applied, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
#2 lore raw

----- Původní zpráva -----

Quoted 6 lines · Axel Lin
Quoted 3 lines

In the case of goto err2, what we want is to call platform_device_del() instead of platform_device_unregister(). Otherwise, we call platform_device_put() twice.

Patch applied, thanks.

Thanks guys, good catch!

Cheers

Quoted 6 lines

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/