Skip to content

Commit

Permalink
firewire: fw-sbp2: fix reference counting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Richter committed Apr 18, 2008
1 parent bd7dee6 commit 7c1fca3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 7c1fca3

Please sign in to comment.