On Fri, May 19, 2006 at 04:14:50PM -0700, Amit Arora wrote: > The scsi_scan_host_selected() should return -EINVAL when the id is equal > to the max_id. Currently it uses ">" when comparing with max_id, and > hence leaves the border case when "id==max_id". > The channel and lun have values valid from 0 up to, > and including, max_channel or max_lun. But, the valid values for id > range from 0 to max_id-1. This patch fixes the problem. You're right, but the patch is wrong. It's not acceptable to have different meanings for variables with such similar names. Either it needs to be renamed to id_count or we need to fix all the other users of max_id. BTW, I think we have another problem with max_lun: max_dev_lun = min(max_scsi_luns, shost->max_lun); ... for (lun = 1; lun < max_dev_lun; ++lun) surely that should be <= ? - : send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html