Netdev List
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Christian Lamparter <chunkeey@googlemail.com>,
	Kalle Valo <kvalo@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"John W. Linville" <linville@tuxdriver.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Christian Lamparter <chunkeey@web.de>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] p54: Fix an error handling path in p54spi_probe()
Date: Sun, 12 Jun 2022 15:45:01 -0500	[thread overview]
Message-ID: <892df159-e73f-be1c-a9c8-bf861fe45d83@lwfinger.net> (raw)
In-Reply-To: <41d88dff4805800691bf4909b14c6122755f7e28.1655063685.git.christophe.jaillet@wanadoo.fr>

On 6/12/22 14:54, Christophe JAILLET wrote:
> If an error occurs after a successful call to p54spi_request_firmware(), it
> must be undone by a corresponding release_firmware() as already done in
> the error handling path of p54spi_request_firmware() and in the .remove()
> function.
> 
> Add the missing call in the error handling path and update some goto
> label accordingly.
> 
> Fixes: cd8d3d321285 ("p54spi: p54spi driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/net/wireless/intersil/p54/p54spi.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/intersil/p54/p54spi.c b/drivers/net/wireless/intersil/p54/p54spi.c
> index f99b7ba69fc3..679ac164c994 100644
> --- a/drivers/net/wireless/intersil/p54/p54spi.c
> +++ b/drivers/net/wireless/intersil/p54/p54spi.c
> @@ -650,14 +650,16 @@ static int p54spi_probe(struct spi_device *spi)
>   
>   	ret = p54spi_request_eeprom(hw);
>   	if (ret)
> -		goto err_free_common;
> +		goto err_release_firmaware;
>   
>   	ret = p54_register_common(hw, &priv->spi->dev);
>   	if (ret)
> -		goto err_free_common;
> +		goto err_release_firmaware;
>   
>   	return 0;
>   
> +err_release_firmaware:
> +	release_firmware(priv->firmware);
>   err_free_common:
>   	free_irq(gpio_to_irq(p54spi_gpio_irq), spi);
>   err_free_gpio_irq:

Why "err_release_firmaware" rather than "err_release_firmware"? Otherwise the 
patch looks good.

Larry


  reply	other threads:[~2022-06-12 20:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12 19:54 [PATCH] p54: Fix an error handling path in p54spi_probe() Christophe JAILLET
2022-06-12 20:45 ` Larry Finger [this message]
2022-06-12 20:45 ` Christian Lamparter
2022-06-12 21:02   ` Christophe JAILLET

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=892df159-e73f-be1c-a9c8-bf861fe45d83@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=chunkeey@googlemail.com \
    --cc=chunkeey@web.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox