summaryrefslogtreecommitdiff
path: root/drivers/zorro
diff options
context:
space:
mode:
authorVasiliy Kulikov <segooon@gmail.com>2010-09-19 16:55:21 +0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2010-10-22 09:43:25 +0200
commit10b68799b32d60ff578742d0deebc98afff30dba (patch)
treeeff8e48c1e3738077fe47cb5e8ac7c34867c30d9 /drivers/zorro
parent0c37dd7c41b7391698bbe354b81fe9909c281984 (diff)
zorro: Fix device_register() error handling
If device_register() fails then call put_device(). See comment to device_register. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'drivers/zorro')
-rw-r--r--drivers/zorro/zorro.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c
index 6455f3a244c5..e0c2807b0970 100644
--- a/drivers/zorro/zorro.c
+++ b/drivers/zorro/zorro.c
@@ -142,6 +142,7 @@ static int __init amiga_zorro_probe(struct platform_device *pdev)
error = device_register(&bus->dev);
if (error) {
pr_err("Zorro: Error registering zorro_bus\n");
+ put_device(&bus->dev);
kfree(bus);
return error;
}
@@ -175,6 +176,7 @@ static int __init amiga_zorro_probe(struct platform_device *pdev)
if (error) {
dev_err(&bus->dev, "Error registering device %s\n",
z->name);
+ put_device(&z->dev);
continue;
}
error = zorro_create_sysfs_dev_files(z);