Commit 7e75d73080d822d2bbbd5b0f7f293719dd1f9109
Committed by
Jens Axboe
1 parent
264a047218
Exists in
master
and in
20 other branches
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>
Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff
block/bsg.c
... | ... | @@ -128,7 +128,8 @@ |
128 | 128 | bc = kmem_cache_alloc(bsg_cmd_cachep, GFP_USER); |
129 | 129 | if (unlikely(!bc)) { |
130 | 130 | spin_lock_irq(&bd->lock); |
131 | - goto alloc_fail; | |
131 | + bd->queued_cmds--; | |
132 | + goto out; | |
132 | 133 | } |
133 | 134 | |
134 | 135 | memset(bc, 0, sizeof(*bc)); |
... | ... | @@ -136,8 +137,6 @@ |
136 | 137 | INIT_LIST_HEAD(&bc->list); |
137 | 138 | dprintk("%s: returning free cmd %p\n", bd->name, bc); |
138 | 139 | return bc; |
139 | -alloc_fail: | |
140 | - bd->queued_cmds--; | |
141 | 140 | out: |
142 | 141 | spin_unlock_irq(&bd->lock); |
143 | 142 | return bc; |