summaryrefslogtreecommitdiff
path: root/drivers/target/iscsi
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-07-27 13:58:17 +0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-07-28 00:28:04 +0400
commit4a28a3fa8c37193b105807193b3695048f0050a4 (patch)
tree60c42c12dd1f09a75af0f0a35f98acef4ac7ae0f /drivers/target/iscsi
parent277c5f27a2c86a9a733c0ec0f6a9b1032dfa3e15 (diff)
downloadlinux-4a28a3fa8c37193b105807193b3695048f0050a4.tar.xz
iscsi-target: Fix NULL dereference on allocation failure
This patch fixes a bug in iscsi_target_init_negotiation() where the "goto out" path dereferences "login" which is NULL upon a memory allocation failure. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi')
-rw-r--r--drivers/target/iscsi/iscsi_target_nego.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c
index 713a4d23557a..4d087ac11067 100644
--- a/drivers/target/iscsi/iscsi_target_nego.c
+++ b/drivers/target/iscsi/iscsi_target_nego.c
@@ -978,7 +978,7 @@ struct iscsi_login *iscsi_target_init_negotiation(
pr_err("Unable to allocate memory for struct iscsi_login.\n");
iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
ISCSI_LOGIN_STATUS_NO_RESOURCES);
- goto out;
+ return NULL;
}
login->req = kzalloc(ISCSI_HDR_LEN, GFP_KERNEL);