Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org

authored by

Andy Shevchenko and committed by
Mark Brown
c9d5d6fe 7d1311b9

+2
+2
drivers/spi/spi-dw-pci.c
··· 62 62 if (ret) 63 63 return ret; 64 64 65 + dws->regs = pcim_iomap_table(pdev)[pci_bar]; 66 + 65 67 dws->bus_num = 0; 66 68 dws->num_cs = 4; 67 69 dws->irq = pdev->irq;