提交 7e75d730 编写于 作者: F FUJITA Tomonori 提交者: Jens Axboe

bsg: simplify __bsg_alloc_command failpath

Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 264a0472
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册