mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
pci: layerscape: Change to allocate zeroed memery for struct ls_pcie
As on some incipient Layerscape platforms (LS1043A series) there isn't
separate PF control register block, these registers reside in the LUT
register block, so when the driver detected there isn't 'ctrl', it will
assign the 'lut' address to the ls_pcie->ctrl.
The current code allocate memory for the struct ls_pcie with random
contents, this can result in skipping to assign the ls_pcie->ctrl with
the 'lut' address, then further crash with the incorrect address.
Fixes: 118e58e26e
("pci: layerscape: Split the EP and RC driver")
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
This commit is contained in:
parent
a7c532f94c
commit
ae5cbc43b3
2 changed files with 2 additions and 2 deletions
|
@ -244,7 +244,7 @@ static int ls_pcie_ep_probe(struct udevice *dev)
|
|||
int ret;
|
||||
u32 svr;
|
||||
|
||||
pcie = devm_kmalloc(dev, sizeof(*pcie), GFP_KERNEL);
|
||||
pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
|
||||
if (!pcie)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ static int ls_pcie_probe(struct udevice *dev)
|
|||
|
||||
pcie_rc->bus = dev;
|
||||
|
||||
pcie = devm_kmalloc(dev, sizeof(*pcie), GFP_KERNEL);
|
||||
pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
|
||||
if (!pcie)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
Loading…
Reference in a new issue