diff options
| -rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index c03f29486071..b216de41bff4 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
| @@ -645,7 +645,9 @@ ahc_linux_slave_alloc(struct scsi_device *device) | |||
| 645 | struct ahc_linux_target *targ; | 645 | struct ahc_linux_target *targ; |
| 646 | struct scsi_target *starget = device->sdev_target; | 646 | struct scsi_target *starget = device->sdev_target; |
| 647 | struct ahc_linux_device *dev; | 647 | struct ahc_linux_device *dev; |
| 648 | u_int target_offset; | 648 | unsigned int target_offset; |
| 649 | unsigned long flags; | ||
| 650 | int retval = -ENOMEM; | ||
| 649 | 651 | ||
| 650 | target_offset = starget->id; | 652 | target_offset = starget->id; |
| 651 | if (starget->channel != 0) | 653 | if (starget->channel != 0) |
| @@ -654,12 +656,14 @@ ahc_linux_slave_alloc(struct scsi_device *device) | |||
| 654 | ahc = *((struct ahc_softc **)device->host->hostdata); | 656 | ahc = *((struct ahc_softc **)device->host->hostdata); |
| 655 | if (bootverbose) | 657 | if (bootverbose) |
| 656 | printf("%s: Slave Alloc %d\n", ahc_name(ahc), device->id); | 658 | printf("%s: Slave Alloc %d\n", ahc_name(ahc), device->id); |
| 659 | ahc_lock(ahc, &flags); | ||
| 657 | targ = ahc->platform_data->targets[target_offset]; | 660 | targ = ahc->platform_data->targets[target_offset]; |
| 658 | if (targ == NULL) { | 661 | if (targ == NULL) { |
| 659 | targ = ahc_linux_alloc_target(ahc, starget->channel, starget->id); | 662 | targ = ahc_linux_alloc_target(ahc, starget->channel, starget->id); |
| 660 | struct seeprom_config *sc = ahc->seep_config; | 663 | struct seeprom_config *sc = ahc->seep_config; |
| 661 | if (targ == NULL) | 664 | if (targ == NULL) |
| 662 | return -ENOMEM; | 665 | goto out; |
| 666 | |||
| 663 | if (sc) { | 667 | if (sc) { |
| 664 | unsigned short scsirate; | 668 | unsigned short scsirate; |
| 665 | struct ahc_devinfo devinfo; | 669 | struct ahc_devinfo devinfo; |
| @@ -701,10 +705,13 @@ ahc_linux_slave_alloc(struct scsi_device *device) | |||
| 701 | if (dev == NULL) { | 705 | if (dev == NULL) { |
| 702 | dev = ahc_linux_alloc_device(ahc, targ, device->lun); | 706 | dev = ahc_linux_alloc_device(ahc, targ, device->lun); |
| 703 | if (dev == NULL) | 707 | if (dev == NULL) |
| 704 | return -ENOMEM; | 708 | goto out; |
| 705 | } | 709 | } |
| 710 | retval = 0; | ||
| 706 | 711 | ||
| 707 | return 0; | 712 | out: |
| 713 | ahc_unlock(ahc, &flags); | ||
| 714 | return retval; | ||
| 708 | } | 715 | } |
| 709 | 716 | ||
| 710 | static int | 717 | static int |
