Skip to content

Commit 9d252c2

Browse files
David JefferyLinus Torvalds
authored andcommitted
[PATCH] ips driver 1/4: fix struct length and remove dead code
This small patch fixes the length of the IPS_ENQ struct. It was too short which can cause the adapter to write beyond the the end of the struct during driver initialization and corrupt part of memory.
1 parent bd15d11 commit 9d252c2

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

drivers/scsi/ips.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,13 +1155,6 @@ ips_queue(Scsi_Cmnd *SC, void (*done) (Scsi_Cmnd *)) {
11551155

11561156
ips_next(ha, IPS_INTR_IORL);
11571157

1158-
/* If We were using the CD Boot Flash Buffer, Restore the Old Values */
1159-
if ( ips_FlashData == ha->ioctl_data ) {
1160-
ha->ioctl_data = ha->flash_data;
1161-
ha->ioctl_order = ha->flash_order;
1162-
ha->ioctl_datasize = ha->flash_datasize;
1163-
ips_FlashDataInUse = 0;
1164-
}
11651158
return (0);
11661159
}
11671160

drivers/scsi/ips.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ typedef struct {
714714
uint16_t usConfigUpdateCount;
715715
uint8_t ucBlkFlag;
716716
uint8_t reserved;
717-
uint16_t usAddrDeadDisk[IPS_MAX_CHANNELS * IPS_MAX_TARGETS];
717+
uint16_t usAddrDeadDisk[IPS_MAX_CHANNELS * (IPS_MAX_TARGETS + 1)];
718718
} IPS_ENQ, *PIPS_ENQ;
719719

720720
typedef struct {

0 commit comments

Comments
 (0)