diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2007-01-24 09:05:54 +0100 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-07-16 08:52:45 +0200 |
commit | 7e75d73080d822d2bbbd5b0f7f293719dd1f9109 (patch) | |
tree | e4f352255de5dd985727486c4f922c38d5414782 /block | |
parent | bsg: add cheasy error checks for sysfs stuff (diff) | |
download | linux-7e75d73080d822d2bbbd5b0f7f293719dd1f9109.tar.xz linux-7e75d73080d822d2bbbd5b0f7f293719dd1f9109.zip |
bsg: simplify __bsg_alloc_command failpath
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/bsg.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/block/bsg.c b/block/bsg.c index e97e3ec08ffc..c85d961ee41e 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -128,7 +128,8 @@ static struct bsg_command *__bsg_alloc_command(struct bsg_device *bd) bc = kmem_cache_alloc(bsg_cmd_cachep, GFP_USER); if (unlikely(!bc)) { spin_lock_irq(&bd->lock); - goto alloc_fail; + bd->queued_cmds--; + goto out; } memset(bc, 0, sizeof(*bc)); @@ -136,8 +137,6 @@ static struct bsg_command *__bsg_alloc_command(struct bsg_device *bd) INIT_LIST_HEAD(&bc->list); dprintk("%s: returning free cmd %p\n", bd->name, bc); return bc; -alloc_fail: - bd->queued_cmds--; out: spin_unlock_irq(&bd->lock); return bc; |