]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/scsi.c
[PATCH] Fix crash on big-endian systems during scan
[linux-2.6-omap-h63xx.git] / drivers / scsi / scsi.c
index 6913b0623167ca0c6d45d21862213a958cd215cf..73994e2ac2cb73e3636042945511735bbb17a13f 100644 (file)
@@ -565,7 +565,8 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
        /* 
         * If SCSI-2 or lower, store the LUN value in cmnd.
         */
-       if (cmd->device->scsi_level <= SCSI_2) {
+       if (cmd->device->scsi_level <= SCSI_2 &&
+           cmd->device->scsi_level != SCSI_UNKNOWN) {
                cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
                               (cmd->device->lun << 5 & 0xe0);
        }
@@ -1243,7 +1244,7 @@ static int __init init_scsi(void)
        if (error)
                goto cleanup_sysctl;
 
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
                INIT_LIST_HEAD(&per_cpu(scsi_done_q, i));
 
        printk(KERN_NOTICE "SCSI subsystem initialized\n");