Skip to contentSkip to conversation

iscsi-target: missing kfree() on error path

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 24, 2013 – Jun 25, 2013

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

PATCH 1/1 iscsi-target: missing kfree() on error path

We need to free "payload" before returning.

drivers/target/iscsi/iscsi_target.c +1 -0
index c1106bb..1e59630 100644
@@ -3426,6 +3426,7 @@ static int iscsit_build_sendtargets_response(struct iscsi_cmd *cmd)
 		if (!text_ptr) {
 			pr_err("Unable to locate '=' string in text_in:"
 			       " %s\n", text_in);
+			kfree(payload);
 			return -EINVAL;
 		}
 		/*
#1 lore raw
Quoted 9 lines · Dan Carpenter

We need to free "payload" before returning.

drivers/target/iscsi/iscsi_target.c +0 -0
index c1106bb..1e59630 100644

drivers/target/iscsi/iscsi_target.c static int iscsit_build_sendtargets_response(struct iscsi_cmd *cmd)

Quoted 8 lines
drivers/target/iscsi/iscsi_target.c +1 -1
@@ -3426,6 +3426,7 @@ static int iscsit_build_sendtargets_response(struct iscsi_cmd *cmd)
 		if (!text_ptr) {
 			pr_err("Unable to locate '=' string in text_in:"
 			       " %s\n", text_in);
+			kfree(payload);
 			return -EINVAL;
 		}
 		/*
--

Applied to for-next.

Thanks Dan!

--nab