iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure
authorJoern Engel <joern@logfs.org>
Tue, 2 Sep 2014 21:49:54 +0000 (17:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:52:18 +0000 (14:52 -0700)
commitb329630e27bcbcbc12e4b29d5bdbb82b5702968b
treed06754787d6915476275d89d28f304a698000db4
parent2a46c329707bb19180960f59580e6d33d61c6368
iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure

commit 8ae757d09c45102b347a1bc2867f54ffc1ab8fda upstream.

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>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/iscsi/iscsi_target_parameters.c