Skip to contentSkip to conversation

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

PATCH New James Bottomley 1 participant 1 message Aug 5, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aic7xxx/79xx: fix another potential panic due to a non existent target

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

James

drivers/scsi/aic7xxx/aic79xx_osm.c +2 -2
@@ -1617,9 +1617,9 @@ ahd_send_async(struct ahd_softc *ahd, ch
 		 * are identical to those last reported.
 		 */
 		starget = ahd->platform_data->starget[target];
-		targ = scsi_transport_target_data(starget);
-		if (targ == NULL)
+		if (starget == NULL)
 			break;
+		targ = scsi_transport_target_data(starget);
 
 		target_ppr_options =
 			(spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)
drivers/scsi/aic7xxx/aic7xxx_osm.c +2 -2
@@ -1614,9 +1614,9 @@ ahc_send_async(struct ahc_softc *ahc, ch
 		if (channel == 'B')
 			target_offset += 8;
 		starget = ahc->platform_data->starget[target_offset];
-		targ = scsi_transport_target_data(starget);
-		if (targ == NULL)
+		if (starget == NULL)
 			break;
+		targ = scsi_transport_target_data(starget);
 
 		target_ppr_options =
 			(spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)