]> err.no Git - linux-2.6/commitdiff
firewire: fw-sbp2: fix reference counting
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 24 Feb 2008 18:00:51 +0000 (19:00 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Fri, 18 Apr 2008 15:55:31 +0000 (17:55 +0200)
The reference count of the unit dropped too low in an error path in
sbp2_probe.  Fixed by moving the _get further up.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jarod Wilson <jwilson@redhat.com>
drivers/firewire/fw-sbp2.c

index 62b4e47d0cc00bb19e58de01c3722c522bd2e55a..8fff18e05000819bc9b4614bec90698b73506387 100644 (file)
@@ -1119,6 +1119,7 @@ static int sbp2_probe(struct device *dev)
                goto fail_shost_put;
 
        fw_device_get(device);
+       get_device(&unit->device);
 
        /* Initialize to values that won't match anything in our table. */
        firmware_revision = 0xff000000;
@@ -1134,8 +1135,6 @@ static int sbp2_probe(struct device *dev)
 
        sbp2_init_workarounds(tgt, model, firmware_revision);
 
-       get_device(&unit->device);
-
        /* Do the login in a workqueue so we can easily reschedule retries. */
        list_for_each_entry(lu, &tgt->lu_list, link)
                sbp2_queue_work(lu, 0);