kernel-ark/drivers/ide
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
..
arm palm_bk3710: improve IDE registration 2008-09-02 20:18:47 +02:00
h8300 ide: add ide_host_add() helper 2008-07-23 19:55:57 +02:00
legacy ht6560b: remove old history 2008-07-24 22:53:35 +02:00
mips ide: add ide_host_add() helper 2008-07-23 19:55:57 +02:00
pci ide: Fix pointer arithmetic in hpt3xx driver code (3rd try) 2008-09-10 22:22:34 +02:00
ppc ide/powermac: Fix use of uninitialized pointer on media-bay 2008-07-30 15:26:53 +10:00
ide-acpi.c ide: remove obsoleted "ide=" kernel parameters 2008-07-15 21:21:47 +02:00
ide-atapi.c ide: remove unused PC_FLAG_DRQ_INTERRUPT 2008-07-23 19:56:01 +02:00
ide-cd_ioctl.c ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings 2008-07-23 19:56:02 +02:00
ide-cd_verbose.c block: replace sizeof(rq->cmd) with BLK_MAX_CDB 2008-04-29 14:48:55 +02:00
ide-cd.c remove blk_register_filter and blk_unregister_filter in gendisk 2008-08-29 11:47:07 +02:00
ide-cd.h ide-cd: convert to using the new atapi_flags 2008-07-23 19:56:02 +02:00
ide-disk.c ide-disk: remove stale init_idedisk_capacity() documentation 2008-09-02 20:18:47 +02:00
ide-dma.c ide: fix pre-EIDE SWDMA support on big-endian 2008-08-05 18:16:55 +02:00
ide-floppy.c ide: fix regression caused by ide_device_{get,put}() addition (take 2) 2008-08-05 18:16:59 +02:00
ide-generic.c ide-generic: remove ide_default_{io_base,irq}() inlines (take 3) 2008-07-24 22:53:31 +02:00
ide-io.c ide: add struct ide_tp_ops (take 2) 2008-07-23 19:55:56 +02:00
ide-iops.c ide: fix ide_fix_driveid() 2008-08-05 18:16:56 +02:00
ide-lib.c ide: add struct ide_tp_ops (take 2) 2008-07-23 19:55:56 +02:00
ide-pio-blacklist.c ide: move PIO blacklist to ide-pio-blacklist.c 2008-07-16 20:33:39 +02:00
ide-pnp.c ide: add ide_host_add() helper 2008-07-23 19:55:57 +02:00
ide-probe.c ide: use proper printk() KERN_* levels in ide-probe.c 2008-07-24 22:53:36 +02:00
ide-proc.c ide: trivial sparse annotations 2008-07-24 22:53:34 +02:00
ide-scan-pci.c
ide-tape.c ide: fix regression caused by ide_device_{get,put}() addition (take 2) 2008-08-05 18:16:59 +02:00
ide-taskfile.c ide: enable local IRQs in all handlers for TASKFILE_NO_DATA data phase 2008-07-24 22:53:36 +02:00
ide-timings.c ide: move ide_pio_cycle_time() to ide-timings.c 2008-07-16 20:33:39 +02:00
ide.c ide: add ide_device_{get,put}() helpers 2008-07-24 22:53:15 +02:00
Kconfig ide/Kconfig: mark ide-scsi as deprecated 2008-09-02 20:18:48 +02:00
Makefile ide: remove stale comments from drivers/ide/Makefile 2008-07-24 22:53:36 +02:00
setup-pci.c ide: drop 'name' parameter from ->init_chipset method 2008-07-24 22:53:33 +02:00