diff options
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index a7942e5c8be8..fa3a5918009c 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2590,18 +2590,16 @@ static int sd_probe(struct device *dev) spin_unlock(&sd_index_lock); } while (error == -EAGAIN); - if (error) + if (error) { + sdev_printk(KERN_WARNING, sdp, "sd_probe: memory exhausted.\n"); goto out_put; - - if (index >= SD_MAX_DISKS) { - error = -ENODEV; - sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name space exhausted.\n"); - goto out_free_index; } error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN); - if (error) + if (error) { + sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name length exceeded.\n"); goto out_free_index; + } sdkp->device = sdp; sdkp->driver = &sd_template; |