All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Gaosheng Cui <cuigaosheng1@huawei.com>
Cc: yhchen@faraday-tech.com, mudongliangabcd@gmail.com,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] usb: gadget: fusb300_udc: free irq on the error path in fusb300_probe()
Date: Tue, 22 Nov 2022 17:09:40 +0100	[thread overview]
Message-ID: <Y3z0RNumksn8cUwM@kroah.com> (raw)
In-Reply-To: <20221121014623.769014-1-cuigaosheng1@huawei.com>

On Mon, Nov 21, 2022 at 09:46:23AM +0800, Gaosheng Cui wrote:
> When request_irq(ires1->start) failed in w5300_hw_probe(), irq ires->start
> has not been freed, and on the clean_up3 error path, we also need to free
> ires1->start irq.
> 
> In addition, We need to add free_irq in fusb300_remove(), fix it.
> 
> Fixes: 0fe6f1d1f612 ("usb: udc: add Faraday fusb300 driver")
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
> ---
> v2:
> - Add free_irq in fusb300_remove(), thanks!
>  drivers/usb/gadget/udc/fusb300_udc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/fusb300_udc.c b/drivers/usb/gadget/udc/fusb300_udc.c
> index 9af8b415f303..d6b2f76d2662 100644
> --- a/drivers/usb/gadget/udc/fusb300_udc.c
> +++ b/drivers/usb/gadget/udc/fusb300_udc.c
> @@ -1347,6 +1347,7 @@ static int fusb300_remove(struct platform_device *pdev)
>  	usb_del_gadget_udc(&fusb300->gadget);
>  	iounmap(fusb300->reg);
>  	free_irq(platform_get_irq(pdev, 0), fusb300);
> +	free_irq(platform_get_irq(pdev, 1), fusb300);
>  
>  	fusb300_free_request(&fusb300->ep[0]->ep, fusb300->ep0_req);
>  	for (i = 0; i < FUSB300_MAX_NUM_EP; i++)
> @@ -1432,7 +1433,7 @@ static int fusb300_probe(struct platform_device *pdev)
>  			IRQF_SHARED, udc_name, fusb300);
>  	if (ret < 0) {
>  		pr_err("request_irq1 error (%d)\n", ret);
> -		goto clean_up;
> +		goto clean_up2;

"clean_up2" means nothing.  Please give lables a proper name so that
they can be understood easily.

thanks,

greg k-h

      reply	other threads:[~2022-11-22 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  1:46 [PATCH v2] usb: gadget: fusb300_udc: free irq on the error path in fusb300_probe() Gaosheng Cui
2022-11-22 16:09 ` Greg KH [this message]

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=Y3z0RNumksn8cUwM@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=cuigaosheng1@huawei.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mudongliangabcd@gmail.com \
    --cc=yhchen@faraday-tech.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.