drivers/scsi/sata_vsc.c: inconsistent NULL checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

  2ae5b30ff08cee422c7f6388a759f7
  Author: Dan Williams <[email protected]>
  [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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux