patch-2.0.11 linux/drivers/scsi/scsicam.c

Next file: linux/drivers/scsi/sg.c
Previous file: linux/drivers/scsi/scsi.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.10/linux/drivers/scsi/scsicam.c linux/drivers/scsi/scsicam.c
@@ -22,6 +22,7 @@
 #include <linux/genhd.h>
 #include <linux/kernel.h>
 #include <linux/blk.h>
+#include <asm/unaligned.h>
 #include "scsi.h"
 #include "hosts.h"
 #include "sd.h"
@@ -121,7 +122,8 @@
     	    end_head * end_sector + end_sector;
 
 	/* This is the actual _sector_ number at the end */
-	logical_end = largest->start_sect + largest->nr_sects;
+	logical_end = get_unaligned(&largest->start_sect)
+			+ get_unaligned(&largest->nr_sects);
 
 	/* This is for >1023 cylinders */
         ext_cyl= (logical_end-(end_head * end_sector + end_sector))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov