]> git.baikalelectronics.ru Git - kernel.git/commitdiff
[SCSI] aic7xxx/79xx: fix another potential panic due to a non existent target
authorJames Bottomley <James.Bottomley@steeleye.com>
Fri, 5 Aug 2005 21:24:54 +0000 (16:24 -0500)
committerJames Bottomley <jejb@mulgrave.(none)>
Fri, 5 Aug 2005 21:49:15 +0000 (16:49 -0500)
I ran into this one sending bus resets across the hardware.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/aic7xxx/aic79xx_osm.c
drivers/scsi/aic7xxx/aic7xxx_osm.c

index 40f32bb239723a4132ace21a777838fd0a8b1130..acaeebd504657c863bd6af629099c3cf8f171879 100644 (file)
@@ -1617,9 +1617,9 @@ ahd_send_async(struct ahd_softc *ahd, char channel,
                 * 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)
index e39361ac6a44c7b0c280e21dce519b5099bea4ca..3fbc10e58cc2d22f1b2c602aad8324e0c4fefa2f 100644 (file)
@@ -1618,9 +1618,9 @@ ahc_send_async(struct ahc_softc *ahc, char channel,
                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)