potential null deref in ide_port_apply_params()

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

 



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

--
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