提交 c9d5d6fe 编写于 作者: A Andy Shevchenko 提交者: Mark Brown

spi: dw-pci: fix bug when regs left uninitialized

The commit 04f421e7 "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: 04f421e7 (spi: dw: use managed resources)
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
上级 7d1311b9
...@@ -62,6 +62,8 @@ static int spi_pci_probe(struct pci_dev *pdev, ...@@ -62,6 +62,8 @@ static int spi_pci_probe(struct pci_dev *pdev,
if (ret) if (ret)
return ret; return ret;
dws->regs = pcim_iomap_table(pdev)[pci_bar];
dws->bus_num = 0; dws->bus_num = 0;
dws->num_cs = 4; dws->num_cs = 4;
dws->irq = pdev->irq; dws->irq = pdev->irq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册