* potential null deref in ide_port_apply_params()
@ 2009-07-19 11:44 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2009-07-19 11:44 UTC (permalink / raw)
To: linux-ide
Should the "||" in ide_port_for_each_dev() be changed to "&&"? With the
current code it looks like "drive" could be null ide_port_apply_params().
#define ide_port_for_each_dev(i, dev, port) \
for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++)
Here is ide_port_apply_params() from drivers/ide/ide.c
361 ide_port_for_each_dev(i, drive, hwif)
362 ide_dev_apply_params(drive, i);
There are a couple similar macros and the callers generally seem to assume
that drive is non null.
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-19 12:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 11:44 potential null deref in ide_port_apply_params() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox