OSDN Git Service

PCI: Fix issue with "pci=disable_acs_redir" parameter being ignored
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 10 Apr 2019 21:05:31 +0000 (15:05 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 12 Apr 2019 20:32:08 +0000 (15:32 -0500)
commitd5bc73f34cc97c4b4b9202cc93182c2515076edf
tree91a010b549580aeed358fb85267ad558ec82721c
parent3943af9d01e94330d0cfac6fccdbc829aad50c92
PCI: Fix issue with "pci=disable_acs_redir" parameter being ignored

In most cases, kmalloc() will not be available early in boot when
pci_setup() is called.  Thus, the kstrdup() call that was added to fix the
__initdata bug with the disable_acs_redir parameter usually returns NULL,
so the parameter is discarded and has no effect.

To fix this, store the string that's in initdata until an initcall function
can allocate the memory appropriately.  This way we don't need any
additional static memory.

Fixes: d2fd6e81912a ("PCI: Fix __initdata issue with "pci=disable_acs_redir" parameter")
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c