From 77d2f1aaf0973ec8e6e9665666869b9faa4b9fbd Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 28 Nov 2012 13:41:44 +0000 Subject: [PATCH] qla2x00t: Keep smatch happy (merge r4486 from trunk) Smatch reports two warnings on the qla2x00t code: * sess->local being tested while sess can be NULL. * The code after the out_unreg_target2x label is only necessary in the procfs build. git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4629 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla2x00-target/qla2x00t.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 0ac2dcd15..95c8f23b1 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -1274,7 +1274,7 @@ static void q2t_fc_port_added(scsi_qla_host_t *ha, fc_port_t *fcport) sess->conf_compl_supported = fcport->conf_compl_supported; } - if (sess->local) { + if (sess && sess->local) { TRACE(TRACE_MGMT, "qla2x00t(%ld): local session for " "port %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x " "(loop ID %d) became global", ha->instance, @@ -6634,9 +6634,9 @@ out: #ifdef CONFIG_SCST_PROC out_unreg_target2x: -#endif scst_unregister_target_template(&tgt2x_template); qla2xxx_tgt_unregister_driver(); +#endif out_mempool_free: mempool_destroy(q2t_mgmt_cmd_mempool);