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