Skip to contentSkip to conversation

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

PATCH Applied Andy Shevchenko 2 participants 3 messages Aug 27, 2014 1 message not in the archive SPI

lore
Share & tools
lore
#0 lore raw

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
index e203d8f..473bd52 100644
@@ -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
maintainer Applied
#1 lore raw
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 struct dw_spi left 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).

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
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 struct dw_spi left 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