Skip to contentSkip to conversation

dpt_i2o: Add a missing call to kfree

PATCH Applied Quentin Lambert 2 participants 2 messages Nov 19, 2016 – Nov 29, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dpt_i2o: Add a missing call to kfree

Most error branches following the call to kzalloc contain a call to kfree. This patch add these calls where they are missing.

This issue was found with Hector.

---
 drivers/scsi/dpt_i2o.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/dpt_i2o.c +3 -1
@@ -1754,8 +1754,10 @@ static int adpt_i2o_passthru(adpt_hba* p
 	sg_offset = (msg[0]>>4)&0xf;
 	msg[2] = 0x40000000; // IOCTL context
 	msg[3] = adpt_ioctl_to_context(pHba, reply);
-	if (msg[3] = (u32)-1)
+	if (msg[3] = (u32)-1) {
+		kfree(reply);
 		return -EBUSY;
+	}
 
 	memset(sg_list,0, sizeof(sg_list[0])*pHba->sg_tablesize);
 	if(sg_offset) {
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Quentin" = Quentin Lambert <[email protected]> writes:

Quentin> Most error branches following the call to kzalloc contain a Quentin> call to kfree. This patch add these calls where they are Quentin> missing.

Applied to 4.10/scsi-queue.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering