Thread (1 message) 1 message, 1 author, 2013-12-19
STALE4590d

[PATCH 08/38] arm: mach-rpc: add missing put_device call

From: Levente Kurusa <hidden>
Date: 2013-12-19 15:16:05
Also in: lkml
Subsystem: arm port, arm/riscpc architecture, the rest · Maintainers: Russell King, Linus Torvalds

This is required so that we give up the last reference to the device.

Signed-off-by: Levente Kurusa <redacted>
---
 arch/arm/mach-rpc/ecard.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c
index fcb1d59..1c5f7cb 100644
--- a/arch/arm/mach-rpc/ecard.c
+++ b/arch/arm/mach-rpc/ecard.c
@@ -961,8 +961,10 @@ static int __init ecard_probe(int slot, unsigned irq, card_type_t type)
 	slot_to_expcard[slot] = ec;
 
 	rc = device_register(&ec->dev);
-	if (rc)
+	if (rc) {
+		put_device(&ec->dev);
 		goto nodev;
+	}
 
 	return 0;
 
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help