Skip to content

Commit 8189aa5

Browse files
Dan Carpenterkwilczynski
authored andcommitted
PCI: dwc: ep: Return -ENOMEM for allocation failures
If the bitmap or memory allocations fail, then dw_pcie_ep_init_registers() will incorrectly return a success. Return -ENOMEM instead. Fixes: 869bc52 ("PCI: dwc: ep: Fix DBI access failure for drivers requiring refclk from host") Signed-off-by: Dan Carpenter <[email protected]> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 046e9b9 commit 8189aa5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/pci/controller/dwc/pcie-designware-ep.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ int dw_pcie_ep_init_registers(struct dw_pcie_ep *ep)
774774
if (ret)
775775
return ret;
776776

777+
ret = -ENOMEM;
777778
if (!ep->ib_window_map) {
778779
ep->ib_window_map = devm_bitmap_zalloc(dev, pci->num_ib_windows,
779780
GFP_KERNEL);

0 commit comments

Comments
 (0)