Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Eric Sesterhenn <snakebyte@gmx.de>
To: linux-ide@vger.kernel.org
Subject: Is drive->id always set when ide_dma_check () gets called?
Date: Mon, 21 Aug 2006 00:51:10 +0200	[thread overview]
Message-ID: <1156114270.7078.6.camel@alice> (raw)

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


                 reply	other threads:[~2006-08-20 22:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1156114270.7078.6.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox