diff options
author | Asai Thambi S P <asamymuthupa@micron.com> | 2012-04-16 21:27:55 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-05-11 16:42:14 +0200 |
commit | a09ba13eefb155a00d8d50008a0c0a2406985ddd (patch) | |
tree | 1afe2bddb155f43ac9cfbad623aa6550cc4d4e84 /drivers/block | |
parent | d88a440eddf288c967daed827147e1121c2ab6b5 (diff) | |
download | op-kernel-dev-a09ba13eefb155a00d8d50008a0c0a2406985ddd.zip op-kernel-dev-a09ba13eefb155a00d8d50008a0c0a2406985ddd.tar.gz |
mtip32xx: release the semaphore on an error path
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>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 00f9fc9..304000c 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -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; } |