Skip to content

Commit 8ae757d

Browse files
Joern EngelNicholas Bellinger
authored andcommitted
iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure
In iscsi_copy_param_list() a failed iscsi_param_list memory allocation currently invokes iscsi_release_param_list() to cleanup, and will promptly trigger a NULL pointer dereference. Instead, go ahead and return for the first iscsi_copy_param_list() failure case. Found by coverity. Signed-off-by: Joern Engel <[email protected]> Cc: <[email protected]> # v3.1+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent b53b0d9 commit 8ae757d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/target/iscsi/iscsi_target_parameters.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ int iscsi_copy_param_list(
601601
param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL);
602602
if (!param_list) {
603603
pr_err("Unable to allocate memory for struct iscsi_param_list.\n");
604-
goto err_out;
604+
return -1;
605605
}
606606
INIT_LIST_HEAD(&param_list->param_list);
607607
INIT_LIST_HEAD(&param_list->extra_response_list);

0 commit comments

Comments
 (0)