LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* drivers/message/fusion/mptscsih.c: inconsequent NULL checking
@ 2007-03-19 9:22 Adrian Bunk
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2007-03-19 9:22 UTC (permalink / raw)
To: Eric.Moore; +Cc: mpt_linux_developer, linux-scsi, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* drivers/message/fusion/mptscsih.c: inconsequent NULL checking
@ 2007-07-23 13:24 Adrian Bunk
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2007-07-23 13:24 UTC (permalink / raw)
To: Eric.Moore; +Cc: mpt_linux_developer, linux-scsi, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-23 13:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-19 9:22 drivers/message/fusion/mptscsih.c: inconsequent NULL checking Adrian Bunk
2007-07-23 13:24 Adrian Bunk
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).