From: Andy Shevchenko Date: Wed, 27 Aug 2014 13:21:12 +0000 (+0300) Subject: spi: dw-pci: fix bug when regs left uninitialized X-Git-Tag: v4.9.8~5793^2~1^2^5~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9d5d6fe168fd45a4dfdd0116affe708789b4702;p=platform%2Fkernel%2Flinux-rpi3.git 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: Andy Shevchenko Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c index 3f3dc12..e149604 100644 --- a/drivers/spi/spi-dw-pci.c +++ b/drivers/spi/spi-dw-pci.c @@ -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;