Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b89dad0 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by James Bottomley
Browse files

[SCSI] audit drivers for incorrect max_id use



max_id now means the maximum number of ids on the bus, which means it
is one greater than the largest possible id number.

Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 091686d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ NCR_700_detect(struct scsi_host_template *tpnt,
	dma_sync_single_for_device(hostdata->dev, pScript, sizeof(SCRIPT), DMA_TO_DEVICE);
	hostdata->state = NCR_700_HOST_FREE;
	hostdata->cmd = NULL;
	host->max_id = 7;
	host->max_id = 8;
	host->max_lun = NCR_700_MAX_LUNS;
	BUG_ON(NCR_700_transport_template == NULL);
	host->transportt = NCR_700_transport_template;
+2 −2
Original line number Diff line number Diff line
@@ -709,7 +709,7 @@ request_synchronous (int host, int target) {
	printk (KERN_ALERT "target %d is host ID\n", target);
	return -1;
    } 
    else if (target > h->max_id) {
    else if (target >= h->max_id) {
	printk (KERN_ALERT "target %d exceeds maximum of %d\n", target,
	    h->max_id);
	return -1;
@@ -3622,7 +3622,7 @@ NCR53c7xx_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) {
#ifdef LINUX_1_2
	|| cmd->device->id > 7
#else
	|| cmd->device->id > host->max_id
	|| cmd->device->id >= host->max_id
#endif
	|| cmd->device->id == host->this_id
	|| hostdata->state == STATE_DISABLED) {
+2 −2
Original line number Diff line number Diff line
@@ -9396,8 +9396,8 @@ ahd_find_tmode_devs(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb,
	} else {
		u_int max_id;

		max_id = (ahd->features & AHD_WIDE) ? 15 : 7;
		if (ccb->ccb_h.target_id > max_id)
		max_id = (ahd->features & AHD_WIDE) ? 16 : 8;
		if (ccb->ccb_h.target_id >= max_id)
			return (CAM_TID_INVALID);

		if (ccb->ccb_h.target_lun >= AHD_NUM_LUNS)
+2 −2
Original line number Diff line number Diff line
@@ -6774,8 +6774,8 @@ ahc_find_tmode_devs(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb,
	} else {
		u_int max_id;

		max_id = (ahc->features & AHC_WIDE) ? 15 : 7;
		if (ccb->ccb_h.target_id > max_id)
		max_id = (ahc->features & AHC_WIDE) ? 16 : 8;
		if (ccb->ccb_h.target_id >= max_id)
			return (CAM_TID_INVALID);

		if (ccb->ccb_h.target_lun >= AHC_NUM_LUNS)
+1 −1
Original line number Diff line number Diff line
@@ -3047,7 +3047,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
		if (atp_dev.chip_ver == 4)
			shpnt->max_id = 16;
		else		
			shpnt->max_id = 7;
			shpnt->max_id = 8;
		shpnt->this_id = host_id;
		shpnt->unique_id = base_io;
		shpnt->io_port = base_io;