All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Ferreri Tonello <eu@felipetonello.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] usb: gadget: f_midi: unlock on error
Date: Mon, 04 Apr 2016 09:43:52 +0000	[thread overview]
Message-ID: <57023758.4030301@felipetonello.com> (raw)
In-Reply-To: <20160402045108.GD11775@mwanda>

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

Hi Dan,

On 02/04/16 05:51, Dan Carpenter wrote:
> We added some new locking here, but missed an error path where we need
> to unlock.
> 
> Fixes: 9acdf4df2fc4 ('usb: gadget: f_midi: added spinlock on transmit function')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Felipe F. Tonello <eu@felipetonello.com>

> 
> diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
> index 56e2dde..2c0616c 100644
> --- a/drivers/usb/gadget/function/f_midi.c
> +++ b/drivers/usb/gadget/function/f_midi.c
> @@ -609,8 +609,10 @@ static void f_midi_transmit(struct f_midi *midi)
>  
>  	do {
>  		ret = f_midi_do_transmit(midi, ep);
> -		if (ret < 0)
> +		if (ret < 0) {
> +			spin_unlock_irqrestore(&midi->transmit_lock, flags);
>  			goto drop_out;
> +		}
>  	} while (ret);
>  
>  	spin_unlock_irqrestore(&midi->transmit_lock, flags);
> 

-- 
Felipe

[-- Attachment #2: 0x92698E6A.asc --]
[-- Type: application/pgp-keys, Size: 7195 bytes --]

  reply	other threads:[~2016-04-04  9:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-02  4:51 [patch] usb: gadget: f_midi: unlock on error Dan Carpenter
2016-04-04  9:43 ` Felipe Ferreri Tonello [this message]
2016-04-04 12:11 ` Michal Nazarewicz
2016-04-04 12:18 ` Felipe Balbi
2016-04-04 13:22 ` Felipe Ferreri Tonello
2016-04-04 19:25 ` Michal Nazarewicz

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=57023758.4030301@felipetonello.com \
    --to=eu@felipetonello.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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.