From 6b5138c2101aee955a0a12702233541878f35996 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Tue, 17 May 2005 21:09:52 -0500 Subject: [PATCH] --- yaml --- r: 1313 b: refs/heads/master c: fb3089dfb58bf07992252b42e77c6f35d45dff5e h: refs/heads/master i: 1311: d22642a0b92f07510b27a85f9fbaafb4cc65955c v: v3 --- [refs] | 2 +- trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index f2336388c0fe..92b1c3e5d1be 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c7525233d2df39b95552f6f49c6b390a9c4d2e80 +refs/heads/master: fb3089dfb58bf07992252b42e77c6f35d45dff5e diff --git a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c index c03f29486071..b216de41bff4 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -645,7 +645,9 @@ ahc_linux_slave_alloc(struct scsi_device *device) struct ahc_linux_target *targ; struct scsi_target *starget = device->sdev_target; struct ahc_linux_device *dev; - u_int target_offset; + unsigned int target_offset; + unsigned long flags; + int retval = -ENOMEM; target_offset = starget->id; if (starget->channel != 0) @@ -654,12 +656,14 @@ ahc_linux_slave_alloc(struct scsi_device *device) ahc = *((struct ahc_softc **)device->host->hostdata); if (bootverbose) printf("%s: Slave Alloc %d\n", ahc_name(ahc), device->id); + ahc_lock(ahc, &flags); targ = ahc->platform_data->targets[target_offset]; if (targ == NULL) { targ = ahc_linux_alloc_target(ahc, starget->channel, starget->id); struct seeprom_config *sc = ahc->seep_config; if (targ == NULL) - return -ENOMEM; + goto out; + if (sc) { unsigned short scsirate; struct ahc_devinfo devinfo; @@ -701,10 +705,13 @@ ahc_linux_slave_alloc(struct scsi_device *device) if (dev == NULL) { dev = ahc_linux_alloc_device(ahc, targ, device->lun); if (dev == NULL) - return -ENOMEM; + goto out; } + retval = 0; - return 0; + out: + ahc_unlock(ahc, &flags); + return retval; } static int