original_kernel/drivers/ide/pci
Masoud Sharbiani 62ff2ecf7a ide: Fix pointer arithmetic in hpt3xx driver code (3rd try)
git commit 74811f355f 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 <masouds@google.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
[bart: use dev_get_drvdata() per Sergei's suggestion]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-09-10 22:22:34 +02:00
..
Makefile
aec62xx.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
alim15x3.c
amd74xx.c
atiixp.c
cmd64x.c
cmd640.c
cs5520.c
cs5530.c
cs5535.c
cy82c693.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
delkin_cb.c
generic.c
hpt34x.c
hpt366.c ide: Fix pointer arithmetic in hpt3xx driver code (3rd try) 2008-09-10 22:22:34 +02:00
it821x.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
it8213.c
jmicron.c
ns87415.c
opti621.c
pdc202xx_new.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
pdc202xx_old.c
piix.c
rz1000.c
sc1200.c
scc_pata.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
serverworks.c
sgiioc4.c sgiioc4: fixup message on resource allocation failure 2008-08-18 21:40:04 +02:00
siimage.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
sis5513.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
sl82c105.c
slc90e66.c
tc86c001.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
triflex.c
trm290.c
via82cxxx.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00