Skip to content

Commit

Permalink
spi: dw-pci: fix bug when regs left uninitialized
Browse files Browse the repository at this point in the history
The commit 04f421e "spi: dw: use managed resources" changes drivers to use
managed functions, but seems wasn't properly tested in PCI case. The regs field
of struct dw_spi left uninitialized. Thus, kernel crashes when tries to access
to the SPI controller registers. This patch fixes the issue.

Fixes: 04f421e (spi: dw: use managed resources)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
  • Loading branch information
Andy Shevchenko authored and Mark Brown committed Aug 27, 2014
1 parent 7d1311b commit c9d5d6f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/spi/spi-dw-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ static int spi_pci_probe(struct pci_dev *pdev,
if (ret)
return ret;

dws->regs = pcim_iomap_table(pdev)[pci_bar];

dws->bus_num = 0;
dws->num_cs = 4;
dws->irq = pdev->irq;
Expand Down

0 comments on commit c9d5d6f

Please sign in to comment.