* Is drive->id always set when ide_dma_check () gets called?
@ 2006-08-20 22:51 Eric Sesterhenn
0 siblings, 0 replies; only message in thread
From: Eric Sesterhenn @ 2006-08-20 22:51 UTC (permalink / raw)
To: linux-ide
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-08-20 22:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-20 22:51 Is drive->id always set when ide_dma_check () gets called? Eric Sesterhenn
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).