linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: qla2xxx: Add LLD target-mode infrastructure for >= 24xx series
@ 2012-03-13 17:20 Dan Carpenter
  2012-03-15 23:10 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2012-03-13 17:20 UTC (permalink / raw)
  To: nab; +Cc: linux-driver, linux-scsi

Hello Nicholas,

The patch 962f988d031f: "qla2xxx: Add LLD target-mode infrastructure 
for >= 24xx series" from Mar 8, 2012, leads to the following Smatch
warning:

drivers/scsi/qla2xxx/qla_target.c:3207 qla_tgt_handle_srr_work()
	 error: potential null derefence 'vha'.


drivers/scsi/qla2xxx/qla_target.c
  3198                  imm = NULL;
  3199                  list_for_each_entry_safe(i, ti, &tgt->srr_imm_list,
  3200                                                  srr_list_entry) {
  3201                          if (i->srr_id == sctio->srr_id) {
  3202                                  list_del(&i->srr_list_entry);
  3203                                  if (imm) {
  3204                                          printk(KERN_ERR "qla_target(%d): There must "
  3205                                            "be only one IMM SRR per CTIO SRR "
  3206                                            "(IMM SRR %p, id %d, CTIO %p\n",
  3207                                            vha->vp_idx, i, i->srr_id, sctio);
                                                  ^^^
It looks like "vha" might not be initialized yet.

  3208                                          qla_tgt_reject_free_srr_imm(vha, i, 0);
  3209                                  } else
  3210                                          imm = i;
  3211                          }
  3212                  }
  3213  
  3214                  ql_dbg(ql_dbg_tgt_mgt, tgt->vha, 0xe12f, "IMM SRR %p, CTIO SRR %p (id %d)\n",
  3215                          imm, sctio, sctio->srr_id);
  3216  
  3217                  if (imm == NULL) {
  3218                          ql_dbg(ql_dbg_tgt_mgt, tgt->vha, 0xe130, "Not found matching IMM"
  3219                                  " for SRR CTIO (id %d)\n", sctio->srr_id);
  3220                          continue;
  3221                  } else
  3222                          list_del(&sctio->srr_list_entry);
  3223  
  3224                  spin_unlock_irqrestore(&tgt->srr_lock, flags);
  3225  
  3226                  cmd = sctio->cmd;
  3227                  vha = cmd->vha;
                        ^^^
It gets set here.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread
* re: qla2xxx: Add LLD target-mode infrastructure for >= 24xx series
@ 2012-05-07 13:59 Dan Carpenter
  2012-05-07 20:51 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2012-05-07 13:59 UTC (permalink / raw)
  To: nab; +Cc: linux-scsi

Hello Nicholas Bellinger,

This is a semi-automatic email about new static checker warnings.

The patch 2c0532cbbbb5: "qla2xxx: Add LLD target-mode infrastructure 
for >= 24xx series" from May 3, 2012, leads to the following Smatch 
complaint:

drivers/scsi/qla2xxx/qla_target.c:2965 qlt_abort_task()
	 error: we previously assumed 'sess' could be null (see line 2958)

drivers/scsi/qla2xxx/qla_target.c
  2957		sess = ha->tgt.tgt_ops->find_sess_by_loop_id(vha, loop_id);
  2958		if (sess == NULL) {
                    ^^^^^^^^^^^^
New check.

  2959			ql_dbg(ql_dbg_tgt_mgt, vha, 0xf025,
  2960			    "qla_target(%d): task abort for unexisting "
  2961			    "session\n", vha->vp_idx);
  2962			res = qlt_sched_sess_work(ha->tgt.qla_tgt,
  2963			    QLA_TGT_SESS_WORK_ABORT, iocb, sizeof(*iocb));
  2964			if (res != 0)
  2965				sess->tgt->tm_to_unknown = 1;
                                ^^^^^^^^^
New dereference.

  2966	
  2967			return res;

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-07 20:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-13 17:20 qla2xxx: Add LLD target-mode infrastructure for >= 24xx series Dan Carpenter
2012-03-15 23:10 ` Nicholas A. Bellinger
2012-03-16 13:59   ` Jörn Engel
2012-03-17  1:22     ` Nicholas A. Bellinger
  -- strict thread matches above, loose matches on Subject: below --
2012-05-07 13:59 Dan Carpenter
2012-05-07 20:51 ` Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).