public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Eccher <d.eccher@gmail.com>
To: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Eccher <d.eccher@gmail.com>
Subject: [PATCH 1/1] USB: inode.c: fix unbalanced spin_lock in ep0_write
Date: Fri, 11 Dec 2015 20:56:26 +0100	[thread overview]
Message-ID: <1449863786-7697-1-git-send-email-d.eccher@gmail.com> (raw)

Fix bad unlock balance: ep0_write enter with the locks locked from inode.c:1769,
hence it must exit with spinlock held to avoid double unlock in dev_config.

Signed-off-by: David Eccher <d.eccher@gmail.com>
---
 drivers/usb/gadget/legacy/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index f454c7a..b968c25 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -1144,6 +1144,7 @@ ep0_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
 				} else
 					retval = len;
 
+				spin_lock_irq (&dev->lock);
 				return retval;
 			}
 
-- 
1.8.1.2


             reply	other threads:[~2015-12-11 19:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 19:56 David Eccher [this message]
2015-12-11 20:11 ` [PATCH 1/1] USB: inode.c: fix unbalanced spin_lock in ep0_write Al Viro
2015-12-11 21:12   ` David Eccher
2015-12-11 20:57 ` Sergei Shtylyov

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=1449863786-7697-1-git-send-email-d.eccher@gmail.com \
    --to=d.eccher@gmail.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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