Skip to content

Commit a09ba13

Browse files
asaithambiaxboe
authored andcommitted
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>
1 parent d88a440 commit a09ba13

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/block/mtip32xx/mtip32xx.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2510,8 +2510,10 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd,
25102510
up(&dd->port->cmd_slot);
25112511
return NULL;
25122512
}
2513-
if (unlikely(*tag < 0))
2513+
if (unlikely(*tag < 0)) {
2514+
up(&dd->port->cmd_slot);
25142515
return NULL;
2516+
}
25152517

25162518
return dd->port->commands[*tag].sg;
25172519
}

0 commit comments

Comments
 (0)