Re: [PATCH] mt76: Fix an IS_ERR() vs NULL check in mt76_wmac_probe()

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

 



Dan Carpenter <dan.carpenter@xxxxxxxxxx> writes:

> The devm_ioremap_resource() function never returns NULL, it returns
> error pointers.
>
> Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7603/soc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
> index e13fea80d970..b920be1f5718 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
> @@ -23,9 +23,9 @@ mt76_wmac_probe(struct platform_device *pdev)
>  	}
>  
>  	mem_base = devm_ioremap_resource(&pdev->dev, res);
> -	if (!mem_base) {
> +	if (IS_ERR(mem_base)) {
>  		dev_err(&pdev->dev, "Failed to get memory resource\n");
> -		return -EINVAL;
> +		return PTR_ERR(mem_base);
>  	}

Wei already posted an identical patch:

https://patchwork.kernel.org/patch/10837285/

-- 
Kalle Valo



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux