[PATCH] USB: fix warning caused by autosuspend counter going negative
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 20 Jul 2007 03:44:51 +0000 (20:44 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Aug 2007 15:24:02 +0000 (17:24 +0200)
commit69a7ef0f48c24f0acb35970b0237c8e71f6b822f
tree4999506d251f84ca3bdd27929880879256a1c0a8
parentd4d4eb0442422123ac0fb4a560af2ad481817397
[PATCH] USB: fix warning caused by autosuspend counter going negative

This patch (as937) fixes a minor bug in the autosuspend usage-counting
code.  Each hub's usage counter keeps track of the number of
unsuspended children.  However the current driver increments the
counter after registering a new child, by which time the child may
already have been suspended and caused the counter to go negative.
The obvious solution is to increment the counter before registering
the child.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/usb/core/hub.c