You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Jens Axboe
parent
264a047218
commit
7e75d73080
+2
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user