Skip to content

Commit

Permalink
bsg: simplify __bsg_alloc_command failpath
Browse files Browse the repository at this point in the history
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Jul 16, 2007
1 parent 264a047 commit 7e75d73
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,15 @@ 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));
bc->bd = 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;
Expand Down

0 comments on commit 7e75d73

Please sign in to comment.