public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Eric.Moore@lsi.com
Cc: mpt_linux_developer@lsi.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: drivers/message/fusion/mptscsih.c: inconsequent NULL checking
Date: Mon, 23 Jul 2007 15:24:10 +0200	[thread overview]
Message-ID: <20070723132410.GI26212@stusta.de> (raw)

The Coverity checker spotted the following inconsequent NULL checking in 
drivers/message/fusion/mptscsih.c:

<--  snip  -->

...
int
mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
{
...
        if (vdev
            && (vdev->vtarget->tflags & MPT_TARGET_FLAGS_Q_YES)
            && (SCpnt->device->tagged_supported)) { 
                scsictl = scsidir | MPI_SCSIIO_CONTROL_SIMPLEQ;
        } else {
                scsictl = scsidir | MPI_SCSIIO_CONTROL_UNTAGGED; 
        }
 
        /* Use the above information to set up the message frame
         */
        pScsiReq->TargetID = (u8) vdev->vtarget->id;
...

<--  snip  -->

"vdev" is first checked but later dereferenced unconditionally.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


             reply	other threads:[~2007-07-23 13:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23 13:24 Adrian Bunk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-03-19  9:22 drivers/message/fusion/mptscsih.c: inconsequent NULL checking Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070723132410.GI26212@stusta.de \
    --to=bunk@stusta.de \
    --cc=Eric.Moore@lsi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mpt_linux_developer@lsi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox