Re: [PATCH 14/14] zorro: fix device_register() error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 19, 2010 at 14:55, Vasiliy Kulikov <segooon@xxxxxxxxx> wrote:
If device_register() fails then call put_device().
See comment to device_register.

Signed-off-by: Vasiliy Kulikov <segooon@xxxxxxxxx>

Thanks, applied to m68k tree, queued for 2.6.37.

---
ÂI cannot compile this driver, so it is not tested at all.

Âdrivers/zorro/zorro.c | Â Â2 ++
Â1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c
index 6455f3a..e0c2807 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);
--
1.7.0.4

Gr{oetje,eeting}s,

            Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
             Â Â -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux