[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4a07016-081b-13b0-2cc4-546f419ad59b@gmail.com>
Date: Wed, 12 Oct 2022 11:52:00 -0400
From: Sean Anderson <seanga2@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Rolf Eike Beer <eike-kernel@...tec.de>,
netdev@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH net] sunhme: fix an IS_ERR() vs NULL check in probe
On 10/12/22 11:01, Dan Carpenter wrote:
> The devm_request_region() function does not return error pointers, it
> returns NULL on error.
>
> Fixes: 914d9b2711dd ("sunhme: switch to devres")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---
> drivers/net/ethernet/sun/sunhme.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> index 62deed210a95..91f10f746dff 100644
> --- a/drivers/net/ethernet/sun/sunhme.c
> +++ b/drivers/net/ethernet/sun/sunhme.c
> @@ -2896,8 +2896,8 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
>
> hpreg_res = devm_request_region(&pdev->dev, pci_resource_start(pdev, 0),
> pci_resource_len(pdev, 0), DRV_NAME);
> - if (IS_ERR(hpreg_res)) {
> - err = PTR_ERR(hpreg_res);
> + if (!hpreg_res) {
> + err = -EBUSY;
> dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
> goto err_out_clear_quattro;
> }
Reviewed-by: Sean Anderson <seanga2@...il.com>
Powered by blists - more mailing lists