Commit 29e79e0f authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

scsi: atp870u: 64 bit bug in atp885_init()

On 64 bit CPUs there is a memory corruption bug on probe().  It should
be a u32 pointer instead of an unsigned long pointer or we write past
the end of the setupdata[] array.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e75fba9c
...@@ -1413,11 +1413,11 @@ static void atp885_init(struct Scsi_Host *shpnt) ...@@ -1413,11 +1413,11 @@ static void atp885_init(struct Scsi_Host *shpnt)
atpdev->global_map[m] = 0; atpdev->global_map[m] = 0;
for (k = 0; k < 4; k++) { for (k = 0; k < 4; k++) {
atp_writew_base(atpdev, 0x3c, n++); atp_writew_base(atpdev, 0x3c, n++);
((unsigned long *)&setupdata[m][0])[k] = atp_readl_base(atpdev, 0x38); ((u32 *)&setupdata[m][0])[k] = atp_readl_base(atpdev, 0x38);
} }
for (k = 0; k < 4; k++) { for (k = 0; k < 4; k++) {
atp_writew_base(atpdev, 0x3c, n++); atp_writew_base(atpdev, 0x3c, n++);
((unsigned long *)&atpdev->sp[m][0])[k] = atp_readl_base(atpdev, 0x38); ((u32 *)&atpdev->sp[m][0])[k] = atp_readl_base(atpdev, 0x38);
} }
n += 8; n += 8;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment