Commit b7fcb8e7 authored by Logan Gunthorpe's avatar Logan Gunthorpe Committed by Xie XiuQi
Browse files

PCI: Fix issue with "pci=disable_acs_redir" parameter being ignored



mainline inclusion
from mainline-v5.1-rc1
commit d5bc73f3
category: bugfix
bugzilla: NA
CVE: NA

-------------------------------------------------

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: d2fd6e81 ("PCI: Fix __initdata issue with "pci=disable_acs_redir" parameter")
Signed-off-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: default avatarYao Hongbo <yaohongbo@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent ed606c8a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment