From: Petr Mladek <pmladek@suse.cz>
To: Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Tejun Heo <tj@kernel.org>,
Joe Lawrence <joe.lawrence@stratus.com>,
Jiri Kosina <jkosina@suse.cz>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Petr Mladek <pmladek@suse.cz>
Subject: [PATCH] usb: hub: wrong order of putting interfaces when processing hub events
Date: Fri, 12 Sep 2014 14:20:21 +0200 [thread overview]
Message-ID: <1410524421-15191-1-git-send-email-pmladek@suse.cz> (raw)
usb_autopm_put_interface() must be called only when usb_autopm_get_interface()
succeeded before. There was wrong ordering of the goto targets.
The funny thing is that the names of the goto targets and the related comments
were correct.
Signed-off-by: Petr Mladek <pmladek@suse.cz>
---
drivers/usb/core/hub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index d481c99a20d7..6afd79ee3340 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5132,12 +5132,12 @@ static void hub_events(void)
loop_autopm:
/* Balance the usb_autopm_get_interface() above */
- usb_autopm_put_interface_no_suspend(intf);
+ usb_autopm_put_interface(intf);
loop:
/* Balance the usb_autopm_get_interface_no_resume() in
* kick_khubd() and allow autosuspend.
*/
- usb_autopm_put_interface(intf);
+ usb_autopm_put_interface_no_suspend(intf);
loop_disconnected:
usb_unlock_device(hdev);
usb_put_dev(hdev);
--
1.8.4
next reply other threads:[~2014-09-12 12:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 12:20 Petr Mladek [this message]
2014-09-12 14:06 ` Alan Stern
2014-09-12 14:21 ` Petr Mladek
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=1410524421-15191-1-git-send-email-pmladek@suse.cz \
--to=pmladek@suse.cz \
--cc=gregkh@linuxfoundation.org \
--cc=jkosina@suse.cz \
--cc=joe.lawrence@stratus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®