aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/tcm_fc
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-06-15 12:41:33 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-06-23 20:03:27 -0400
commit552523dcbf0f33d44d816da310be8227a2c1502a (patch)
treeb3068ed11f76b583996b59f001d68bcc4be25156 /drivers/target/tcm_fc
parent233888644d80cc44330062e5e978c9e3a14c9cb9 (diff)
target: Fix ERR_PTR dereferencing bugs
transport_init_session() and core_tmr_alloc_req() never return NULL, they only return ERR_PTRs on error. v2: Fix patch to return PTR_ERR(tl_nexus->se_sess) from Ankit Jain's feedback. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Ankit Jain <jankit@suse.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/tcm_fc')
-rw-r--r--drivers/target/tcm_fc/tfc_sess.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c
index a3bd57f2ea32..03744c23095c 100644
--- a/drivers/target/tcm_fc/tfc_sess.c
+++ b/drivers/target/tcm_fc/tfc_sess.c
@@ -229,7 +229,7 @@ static struct ft_sess *ft_sess_create(struct ft_tport *tport, u32 port_id,
229 return NULL; 229 return NULL;
230 230
231 sess->se_sess = transport_init_session(); 231 sess->se_sess = transport_init_session();
232 if (!sess->se_sess) { 232 if (IS_ERR(sess->se_sess)) {
233 kfree(sess); 233 kfree(sess);
234 return NULL; 234 return NULL;
235 } 235 }