Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1526100

[PATCH] [SCSI] dpt_i2o: Add a missing call to kfree

From Quentin Lambert <lambert.quentin@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] [SCSI] dpt_i2o: Add a missing call to kfree
Date 2016-11-19 19:00 +0100
Message-ID <sFi5I-82A-33@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>

---
 drivers/scsi/dpt_i2o.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -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) {

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] [SCSI] dpt_i2o: Add a missing call to kfree Quentin Lambert <lambert.quentin@gmail.com> - 2016-11-19 19:00 +0100

csiph-web