浏览代码

[SCSI] aic7xxx/79xx: fix another potential panic due to a non existent target

I ran into this one sending bus resets across the hardware.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
James Bottomley 20 年之前
父节点
当前提交
fc789a9399
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      drivers/scsi/aic7xxx/aic79xx_osm.c
  2. 2 2
      drivers/scsi/aic7xxx/aic7xxx_osm.c

+ 2 - 2
drivers/scsi/aic7xxx/aic79xx_osm.c

@@ -1617,9 +1617,9 @@ ahd_send_async(struct ahd_softc *ahd, char channel,
 		 * are identical to those last reported.
 		 * are identical to those last reported.
 		 */
 		 */
 		starget = ahd->platform_data->starget[target];
 		starget = ahd->platform_data->starget[target];
-		targ = scsi_transport_target_data(starget);
-		if (targ == NULL)
+		if (starget == NULL)
 			break;
 			break;
+		targ = scsi_transport_target_data(starget);
 
 
 		target_ppr_options =
 		target_ppr_options =
 			(spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)
 			(spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)

+ 2 - 2
drivers/scsi/aic7xxx/aic7xxx_osm.c

@@ -1618,9 +1618,9 @@ ahc_send_async(struct ahc_softc *ahc, char channel,
 		if (channel == 'B')
 		if (channel == 'B')
 			target_offset += 8;
 			target_offset += 8;
 		starget = ahc->platform_data->starget[target_offset];
 		starget = ahc->platform_data->starget[target_offset];
-		targ = scsi_transport_target_data(starget);
-		if (targ == NULL)
+		if (starget == NULL)
 			break;
 			break;
+		targ = scsi_transport_target_data(starget);
 
 
 		target_ppr_options =
 		target_ppr_options =
 			(spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)
 			(spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)