From: FUJITA Tomonori Date: Wed, 24 Jan 2007 08:05:54 +0000 (+0100) Subject: bsg: simplify __bsg_alloc_command failpath X-Git-Tag: v2.6.23-rc1~782^2~11 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7e75d73080d822d2bbbd5b0f7f293719dd1f9109;p=linux-2.6-omap-h63xx.git bsg: simplify __bsg_alloc_command failpath Signed-off-by: FUJITA Tomonori Signed-off-by: Jens Axboe --- diff --git a/block/bsg.c b/block/bsg.c index e97e3ec08ff..c85d961ee41 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;