Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101536
b: refs/heads/master
c: 3f27e3e
h: refs/heads/master
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Jul 12, 2008
1 parent ce83fab commit c913a2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30e9ba9f2001f45960507f1963551311a67d0209
refs/heads/master: 3f27e3ed11e67c5ee19d560a50eafd93cf8c6682
9 changes: 6 additions & 3 deletions trunk/block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,13 @@ static int bsg_put_device(struct bsg_device *bd)
mutex_lock(&bsg_mutex);

do_free = atomic_dec_and_test(&bd->ref_count);
if (!do_free)
if (!do_free) {
mutex_unlock(&bsg_mutex);
goto out;
}

hlist_del(&bd->dev_list);
mutex_unlock(&bsg_mutex);

dprintk("%s: tearing down\n", bd->name);

Expand All @@ -741,10 +746,8 @@ static int bsg_put_device(struct bsg_device *bd)
*/
ret = bsg_complete_all_commands(bd);

hlist_del(&bd->dev_list);
kfree(bd);
out:
mutex_unlock(&bsg_mutex);
kref_put(&q->bsg_dev.ref, bsg_kref_release_function);
if (do_free)
blk_put_queue(q);
Expand Down

0 comments on commit c913a2f

Please sign in to comment.