mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 09:14:19 +08:00
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>
This commit is contained in:
parent
277c5f27a2
commit
4a28a3fa8c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user