Messages in this thread Patch in this message | | | Date | Fri, 4 Mar 2022 15:39:21 -0600 | From | Bjorn Helgaas <> | Subject | Re: [PATCH] PCI: dwc: solve returning success but actually failed |
| |
On Fri, Mar 04, 2022 at 12:06:10PM +0000, Zhangjiantao(Kirin,Nanjing) wrote: > When dma_mapping_error returns error because of no enough memory available, dw_pcie_host_init will return success, which will mislead the callers.
Wrap to fit in 75 columns, add "()" after function names. > > Signed-off-by: zhangjianrong <zhangjianrong5@huawei.com> > Signed-off-by: zhangjiantao <water.zhangjiantao@huawei.com> > > --- > drivers/pci/controller/dwc/pcie-designware-host.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c > b/drivers/pci/controller/dwc/pcie-designware-host.c > index f4755f3a03be..ac691d733848 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -393,6 +393,7 @@ int dw_pcie_host_init(struct pcie_port *pp) > if (dma_mapping_error(pci->dev, pp->msi_data)) { > dev_err(pci->dev, "Failed to map MSI data\n"); > pp->msi_data = 0; > + ret = -1;
We should save the return value from dma_mapping_error() and return *that*, not -1.
Whitespace error (indent with tabs, same as the surrounding code).
> goto err_free_msi; > } > } > -- > 2.17.1 >
| |