mtip32xx: release the semaphore on an error path
authorAsai Thambi S P <asamymuthupa@micron.com>
Mon, 16 Apr 2012 19:27:55 +0000 (21:27 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 11 May 2012 14:42:14 +0000 (16:42 +0200)
Release the semaphore in an error path in mtip_hw_get_scatterlist(). This
fixes the smatch warning inconsistent returns.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/mtip32xx/mtip32xx.c

index 00f9fc992090099e72e8f753ab9d58fe47154b46..304000c3d433f1d98afe6c0f0feea8553dc7bd04 100644 (file)
@@ -2510,8 +2510,10 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd,
                up(&dd->port->cmd_slot);
                return NULL;
        }
-       if (unlikely(*tag < 0))
+       if (unlikely(*tag < 0)) {
+               up(&dd->port->cmd_slot);
                return NULL;
+       }
 
        return dd->port->commands[*tag].sg;
 }