ide: Fix pointer arithmetic in hpt3xx driver code (3rd try)
git commit 74811f355f4f69a187fa74892dcf2a684b84ce99 causes crash at
module load (or boot) time on my machine with a hpt374 controller.
The reason for this is that for initializing second controller which sets
(hwif->dev == host->dev[1]) to true (1), adds 1 to a void ptr, which
advances it by one byte instead of advancing it by sizeof(hpt_info) bytes.
Because of this, all initialization functions get corrupted data in info
variable which causes a crash at boot time.
This patch fixes that and makes my machine boot again.
The card itself is a HPT374 raid conroller: Here is the lspci -v output:
03:06.0 RAID bus controller: HighPoint Technologies, Inc. HPT374 (rev
07) Subsystem: HighPoint Technologies, Inc. Unknown device 0001
Flags: bus master, 66MHz, medium devsel, latency 120, IRQ 28
I/O ports at 8000 [size=8]
I/O ports at 7800 [size=4]
I/O ports at 7400 [size=8]
I/O ports at 7000 [size=4]
I/O ports at 6800 [size=256] Expansion ROM at fe8e0000 [disabled] [size=128K] Capabilities: [60] Power Management version 2
03:06.1 RAID bus controller: HighPoint Technologies, Inc. HPT374 (rev
07) Subsystem: HighPoint Technologies, Inc. Unknown device 0001
Flags: bus master, 66MHz, medium devsel, latency 120, IRQ 28
I/O ports at 9800 [size=8]
I/O ports at 9400 [size=4]
I/O ports at 9000 [size=8]
I/O ports at 8800 [size=4]
I/O ports at 8400 [size=256] Capabilities: [60] Power Management version 2
Signed-off-by: Masoud Sharbiani <email address hidden>
Cc: Sergei Shtylyov <email address hidden>
Cc: Andrew Morton <email address hidden>
[bart: use dev_get_drvdata() per Sergei's suggestion]
Signed-off-by: Bartlomiej Zolnierkiewicz <email address hidden>
In the changelog for 2.6.27-rc7 is the following text. If there's a new kernel to try, let me know.
commit 62ff2ecf7a4e69f 7271b7f7a57aaee 76ffe610f2
Author: Masoud Sharbiani <email address hidden>
Date: Wed Sep 10 22:22:34 2008 +0200
ide: Fix pointer arithmetic in hpt3xx driver code (3rd try)
git commit 74811f355f4f69a 187fa74892dcf2a 684b84ce99 causes crash at
module load (or boot) time on my machine with a hpt374 controller.
The reason for this is that for initializing second controller which sets
(hwif->dev == host->dev[1]) to true (1), adds 1 to a void ptr, which
advances it by one byte instead of advancing it by sizeof(hpt_info) bytes.
Because of this, all initialization functions get corrupted data in info
variable which causes a crash at boot time.
This patch fixes that and makes my machine boot again.
The card itself is a HPT374 raid conroller: Here is the lspci -v output:
Subsystem: HighPoint Technologies, Inc. Unknown device 0001
Expansion ROM at fe8e0000 [disabled] [size=128K]
Capabiliti es: [60] Power Management version 2
03:06.0 RAID bus controller: HighPoint Technologies, Inc. HPT374 (rev
07)
Flags: bus master, 66MHz, medium devsel, latency 120, IRQ 28
I/O ports at 8000 [size=8]
I/O ports at 7800 [size=4]
I/O ports at 7400 [size=8]
I/O ports at 7000 [size=4]
I/O ports at 6800 [size=256]
03:06.1 RAID bus controller: HighPoint Technologies, Inc. HPT374 (rev
Subsystem: HighPoint Technologies, Inc. Unknown device 0001
Capabiliti es: [60] Power Management version 2
07)
Flags: bus master, 66MHz, medium devsel, latency 120, IRQ 28
I/O ports at 9800 [size=8]
I/O ports at 9400 [size=4]
I/O ports at 9000 [size=8]
I/O ports at 8800 [size=4]
I/O ports at 8400 [size=256]
Signed-off-by: Masoud Sharbiani <email address hidden>
Cc: Sergei Shtylyov <email address hidden>
Cc: Andrew Morton <email address hidden>
[bart: use dev_get_drvdata() per Sergei's suggestion]
Signed-off-by: Bartlomiej Zolnierkiewicz <email address hidden>