linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/scsi/sata_vsc.c: inconsistent NULL checking
@ 2006-03-09 11:02 Adrian Bunk
  2006-03-09 19:44 ` Dan Williams
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2006-03-09 11:02 UTC (permalink / raw)
  To: Dan Williams; +Cc: Jeff Garzik, linux-ide, linux-kernel

The Coverity checker found this inconsistent NULL checking recently 
introduced by the following commit:

  2ae5b30ff08cee422c7f6388a759f7
  Author: Dan Williams <dan.j.williams@intel.com>
  [PATCH] Necessary evil to get sata_vsc to initialize with Intel iq3124h hba


In function vsc_sata_interrupt():

	err_status = ap ? vsc_sata_scr_read(ap, SCR_ERROR) : 0;
	vsc_sata_scr_write(ap, SCR_ERROR, err_status);


vsc_sata_scr_write() always dereferences ap
(since SCR_ERROR < SCR_CONTROL).

Checking for NULL in one line and unconditionally dereferencing the 
variable in the next line can't be right.

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] 4+ messages in thread

end of thread, other threads:[~2006-03-22  3:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-09 11:02 drivers/scsi/sata_vsc.c: inconsistent NULL checking Adrian Bunk
2006-03-09 19:44 ` Dan Williams
2006-03-09 20:41   ` Dan Williams
2006-03-22  3:08     ` Jeff Garzik

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).