Is drive->id always set when ide_dma_check () gets called?

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

 



hi,

while trying to tackle some more coverity bugs, I came across
bug #206 to #211. They are all about the function they register for 
hwif->ide_dma_check. Basically they all do something like

struct hd_driveid *id	= drive->id

if (id && (id->capability & 1) && drive->autodma) {
	something();
} else if ((id->capability & 8) || (id->field_valid & 2)) {
	something_else();
}

Coverity complains that id is only checked for != NULL in the first case
but not the second. While trying to review the callers, all of them
either checked drive->id or dereferenced it themselves. Only with
probe_hwif() in drivers/ide/ide-probe.c I am not sure. So the question boils down
to: should we,

a) remove the check
b) add the check to the second case
c) just tell coverity to shut up

Thanks for comments,
Eric

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux