aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2014-09-02 17:49:54 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2014-09-17 16:44:01 -0400
commit8ae757d09c45102b347a1bc2867f54ffc1ab8fda (patch)
tree5f161b9fc869430e10864c66f3491dce6b7ecf15 /drivers/target
parentb53b0d99d6fbf7d44330395349a895521cfdbc96 (diff)
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 <joern@logfs.org> Cc: <stable@vger.kernel.org> # v3.1+ Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/iscsi/iscsi_target_parameters.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c
index 02f9de26f38a..18c29260b4a2 100644
--- a/drivers/target/iscsi/iscsi_target_parameters.c
+++ b/drivers/target/iscsi/iscsi_target_parameters.c
@@ -601,7 +601,7 @@ int iscsi_copy_param_list(
601 param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL); 601 param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL);
602 if (!param_list) { 602 if (!param_list) {
603 pr_err("Unable to allocate memory for struct iscsi_param_list.\n"); 603 pr_err("Unable to allocate memory for struct iscsi_param_list.\n");
604 goto err_out; 604 return -1;
605 } 605 }
606 INIT_LIST_HEAD(&param_list->param_list); 606 INIT_LIST_HEAD(&param_list->param_list);
607 INIT_LIST_HEAD(&param_list->extra_response_list); 607 INIT_LIST_HEAD(&param_list->extra_response_list);