Skip to content

Commit a78cff3

Browse files
matweysashalevin
authored andcommitted
PCI: spear: Drop __initdata from spear13xx_pcie_driver
[ Upstream commit a43f32d ] Struct spear13xx_pcie_driver was in initdata, but we passed a pointer to it to platform_driver_register(), which can use the pointer at arbitrary times in the future, even after the initdata is freed. That leads to crashes. Move spear13xx_pcie_driver and things referenced by it (spear13xx_pcie_probe() and dw_pcie_host_init()) out of initdata. [bhelgaas: changelog] Fixes: 6675ef2 ("PCI: spear: Fix Section mismatch compilation warning for probe()") Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> CC: stable@vger.kernel.org # v3.17+ Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 parent f31d609 commit a78cff3

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/pci/host/pcie-designware.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static const struct irq_domain_ops msi_domain_ops = {
342342
.map = dw_pcie_msi_map,
343343
};
344344

345-
int __init dw_pcie_host_init(struct pcie_port *pp)
345+
int dw_pcie_host_init(struct pcie_port *pp)
346346
{
347347
struct device_node *np = pp->dev->of_node;
348348
struct platform_device *pdev = to_platform_device(pp->dev);

‎drivers/pci/host/pcie-spear13xx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int add_pcie_port(struct pcie_port *pp, struct platform_device *pdev)
298298
return 0;
299299
}
300300

301-
static int __init spear13xx_pcie_probe(struct platform_device *pdev)
301+
static int spear13xx_pcie_probe(struct platform_device *pdev)
302302
{
303303
struct spear13xx_pcie *spear13xx_pcie;
304304
struct pcie_port *pp;
@@ -371,7 +371,7 @@ static const struct of_device_id spear13xx_pcie_of_match[] = {
371371
};
372372
MODULE_DEVICE_TABLE(of, spear13xx_pcie_of_match);
373373

374-
static struct platform_driver spear13xx_pcie_driver __initdata = {
374+
static struct platform_driver spear13xx_pcie_driver = {
375375
.probe = spear13xx_pcie_probe,
376376
.driver = {
377377
.name = "spear-pcie",

0 commit comments

Comments
 (0)