From: James Bottomley Date: Fri, 5 Aug 2005 21:24:54 +0000 (-0500) Subject: [SCSI] aic7xxx/79xx: fix another potential panic due to a non existent target X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fc789a93994858b5e5a46afb96d0dcf6cc1b6f08;p=linux-beck.git [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 --- diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 40f32bb23972..acaeebd50465 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/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. */ 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) diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index e39361ac6a44..3fbc10e58cc2 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -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)