Skip to content

Commit

Permalink
ide: fix crash at boot with siimage driver
Browse files Browse the repository at this point in the history
Some change to the IDE layer are causing the siimage driver to crash
at boot with a NULL dereference. This is due to the sil_dma_ops not
containing all the necessary pointers. I suppose it used to just
"override" the defaults while now, it needs to contain everything.

[bart: while at it: sil_dma_ops should be const now (pointed out by Sergei)]

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>,
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Benjamin Herrenschmidt authored and Bartlomiej Zolnierkiewicz committed Apr 29, 2008
1 parent 7663c1e commit b26b0c5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/ide/pci/siimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,15 @@ static const struct ide_port_ops sil_sata_port_ops = {
.cable_detect = sil_cable_detect,
};

static struct ide_dma_ops sil_dma_ops = {
static const struct ide_dma_ops sil_dma_ops = {
.dma_host_set = ide_dma_host_set,
.dma_setup = ide_dma_setup,
.dma_exec_cmd = ide_dma_exec_cmd,
.dma_start = ide_dma_start,
.dma_end = __ide_dma_end,
.dma_test_irq = siimage_dma_test_irq,
.dma_timeout = ide_dma_timeout,
.dma_lost_irq = ide_dma_lost_irq,
};

#define DECLARE_SII_DEV(name_str, p_ops) \
Expand Down

0 comments on commit b26b0c5

Please sign in to comment.