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 <dan.carpenter@linaro.org> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Reviewed-by: Krzysztof Wilczyński <kw@linux.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/36dcb6fc-f292-4dd5-bd45-a8c6f9dc3df7@stanley.mountain
1 parent 046e9b9 commit 8189aa5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)