From: Stefan Richter Date: Sun, 24 Feb 2008 18:00:51 +0000 (+0100) Subject: firewire: fw-sbp2: fix reference counting X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7c1fca336661aaeb70b9094c4b8eaae389027509;p=linux-beck.git firewire: fw-sbp2: fix reference counting 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 Signed-off-by: Jarod Wilson --- diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index 62b4e47d0cc0..8fff18e05000 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c @@ -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);