spi: dw-pci: fix bug when regs left uninitialized
PATCH 1/1 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.
--- drivers/spi/spi-dw-pci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/spi/spi-dw-pci.c +2 -0
@@ -59,6 +59,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;
Signature · 6 lines
2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Andy Shevchenko
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 structdw_spileft uninitialized. Thus, kernel crashes when tries to access to the SPI controller registers. This patch fixes the issue.
Applied. Please use the Fixes: tag and use a minimum of 12 characters for the commit ID (to avoid collisions).
Quoted 8 lines · Mark Brown
Quoted 4 lines · Andy Shevchenko
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 structdw_spileft uninitialized. Thus, kernel crashes when tries to access to the SPI controller registers. This patch fixes the issue.Applied. Please use the Fixes: tag and use a minimum of 12 characters for the commit ID (to avoid collisions).
Noted, thank you!
Signature · 7 lines
Andy Shevchenko <[email protected]> Intel Finland Oy -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html