diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-02-14 07:02:31 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-03-01 21:10:36 -0500 |
commit | 29e79e0fa9b86535c2f1442d080c8cb5dec8606b (patch) | |
tree | 4e9850bea6ffa70fce84cd2c21e178515c6336c0 | |
parent | e75fba9c0668b3767f608ea07485f48d33c270cf (diff) |
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: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/atp870u.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 8b52a9dbb9cf..b46997cf77e2 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c | |||
@@ -1413,11 +1413,11 @@ static void atp885_init(struct Scsi_Host *shpnt) | |||
1413 | atpdev->global_map[m] = 0; | 1413 | atpdev->global_map[m] = 0; |
1414 | for (k = 0; k < 4; k++) { | 1414 | for (k = 0; k < 4; k++) { |
1415 | atp_writew_base(atpdev, 0x3c, n++); | 1415 | atp_writew_base(atpdev, 0x3c, n++); |
1416 | ((unsigned long *)&setupdata[m][0])[k] = atp_readl_base(atpdev, 0x38); | 1416 | ((u32 *)&setupdata[m][0])[k] = atp_readl_base(atpdev, 0x38); |
1417 | } | 1417 | } |
1418 | for (k = 0; k < 4; k++) { | 1418 | for (k = 0; k < 4; k++) { |
1419 | atp_writew_base(atpdev, 0x3c, n++); | 1419 | atp_writew_base(atpdev, 0x3c, n++); |
1420 | ((unsigned long *)&atpdev->sp[m][0])[k] = atp_readl_base(atpdev, 0x38); | 1420 | ((u32 *)&atpdev->sp[m][0])[k] = atp_readl_base(atpdev, 0x38); |
1421 | } | 1421 | } |
1422 | n += 8; | 1422 | n += 8; |
1423 | } | 1423 | } |