Skip to contentSkip to conversation

mtip32xx: release the semaphore on an error path

PATCH In review Asai Thambi S P 2 participants 2 messages Apr 16, 2012 Block layer

lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/block/mtip32xx/mtip32xx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +3 -1
index 00f9fc9..304000c 100644
@@ -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
maintainer
#1 lore raw
Quoted 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