mtip32xx: release the semaphore on an error path
PATCH 1/1 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 <[email protected]>
Signed-off-by Asai Thambi S P <[email protected]>
--- drivers/block/mtip32xx/mtip32xx.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +3 -1
@@ -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; }
Signature · 1 line
1.7.1
Jens Axboe
maintainerQuoted 2 lines · Asai Thambi S P
Release the semaphore in an error path in
mtip_hw_get_scatterlist(). This fixes the smatch warning inconsistent returns.
Thanks Asai, and Dan for the report. Applied.
Signature · 1 line
Jens Axboe