linux/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 ide-pci-generic: kill the unused ifdef/endif/MODULE code 2008-02-06 02:57:49 +01:00
aec62xx.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
alim15x3.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
amd74xx.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
atiixp.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
cmd64x.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
cmd640.c ide: add ide_host_add() helper 2008-07-23 19:55:57 +02:00
cs5520.c cs5520: add enablebits checking 2008-08-05 18:17:03 +02:00
cs5530.c ide: drop 'name' parameter from ->init_chipset method 2008-07-24 22:53:33 +02:00
cs5535.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
cy82c693.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
delkin_cb.c ide: add ide_host_add() helper 2008-07-23 19:55:57 +02:00
generic.c ide: prefix messages from IDE PCI host drivers by driver name 2008-07-24 22:53:32 +02:00
hpt34x.c ide: drop 'name' parameter from ->init_chipset method 2008-07-24 22:53:33 +02:00
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 ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
jmicron.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
ns87415.c ide: prefix messages from IDE PCI host drivers by driver name 2008-07-24 22:53:32 +02:00
opti621.c ide: prefix messages from IDE PCI host drivers by driver name 2008-07-24 22:53:32 +02:00
pdc202xx_new.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
pdc202xx_old.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
piix.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
rz1000.c ide: prefix messages from IDE PCI host drivers by driver name 2008-07-24 22:53:32 +02:00
sc1200.c ide: prefix messages from IDE PCI host drivers by driver name 2008-07-24 22:53:32 +02:00
scc_pata.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
serverworks.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
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 ide: drop 'name' parameter from ->init_chipset method 2008-07-24 22:53:33 +02:00
slc90e66.c ide: ->cable_detect method cannot be marked __devinit 2008-08-05 18:17:04 +02:00
tc86c001.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00
triflex.c ide: prefix messages from IDE PCI host drivers by driver name 2008-07-24 22:53:32 +02:00
trm290.c ide: prefix messages from IDE PCI host drivers by driver name 2008-07-24 22:53:32 +02:00
via82cxxx.c drivers/ide/pci/: use __devexit_p() 2008-08-18 21:40:03 +02:00