The bcm5974 code takes a USB autosuspend reference on device open but
only releases it if there's an error. Repeated opens will bump the count,
which is clearly wrong. It's also unnecessary - the only part of the
driver operation that is incompatible with autosuspend is the initial
setup, and after that the device generates appropriate remote wakeups.
Making the unreference unconditional fixes this.
Signed-off-by: Matthew Garrett <redacted>
---
drivers/input/mouse/bcm5974.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 5ec617e..38d0286 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -764,8 +764,7 @@ static int bcm5974_open(struct input_dev *input)
mutex_unlock(&dev->pm_mutex);
- if (error)
- usb_autopm_put_interface(dev->intf);
+ usb_autopm_put_interface(dev->intf);
return error;
}
--
1.7.6.4