Re: [PATCH 2/2] PCI: endpoint: Fix an IS_ERR() vs NULL bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 09, 2023 at 01:50:09PM +0300, Dan Carpenter wrote:
> The ioremap() function does not return error pointers, it returns NULL
> on error.
> 
> Fixes: 7db424a84d96 ("PCI: endpoint: Add PCI Endpoint function driver for MHI bus")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Reviewed-by: Manivannan Sadhasivam <mani@xxxxxxxxxx>

- Mani

> ---
>  drivers/pci/endpoint/functions/pci-epf-mhi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
> index e7d64b9d12ff..b45db923306b 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
> @@ -354,8 +354,8 @@ static int pci_epf_mhi_bind(struct pci_epf *epf)
>  	epf_mhi->mmio_size = resource_size(res);
>  
>  	epf_mhi->mmio = ioremap(epf_mhi->mmio_phys, epf_mhi->mmio_size);
> -	if (IS_ERR(epf_mhi->mmio))
> -		return PTR_ERR(epf_mhi->mmio);
> +	if (!epf_mhi->mmio)
> +		return -ENOMEM;
>  
>  	ret = platform_get_irq_byname(pdev, "doorbell");
>  	if (ret < 0) {
> -- 
> 2.39.2
> 

-- 
மணிவண்ணன் சதாசிவம்



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux