scsi: core: Cap scsi_host cmd_per_lun at can_queue
[linux-2.6-microblaze.git] / drivers / scsi / hosts.c
index 697c09e..624e258 100644 (file)
@@ -220,6 +220,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
                goto fail;
        }
 
+       shost->cmd_per_lun = min_t(short, shost->cmd_per_lun,
+                                  shost->can_queue);
+
        error = scsi_init_sense_cache(shost);
        if (error)
                goto fail;
@@ -317,7 +320,7 @@ static void scsi_host_dev_release(struct device *dev)
 
        scsi_proc_hostdir_rm(shost->hostt);
 
-       /* Wait for functions invoked through call_rcu(&shost->rcu, ...) */
+       /* Wait for functions invoked through call_rcu(&scmd->rcu, ...) */
        rcu_barrier();
 
        if (shost->tmf_work_q)