diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-07-14 19:00:21 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-08 08:54:29 +0200 |
commit | 9b091d54444c6b6512903ce6758b841b1699c5bf (patch) | |
tree | f39e00ae1d2d157f752386d06e2e766393ad0d29 | |
parent | 40071bc72f52fd0ecc9122858e19644ff1fdcdaf (diff) | |
download | linux-stable-9b091d54444c6b6512903ce6758b841b1699c5bf.tar.gz linux-stable-9b091d54444c6b6512903ce6758b841b1699c5bf.tar.bz2 linux-stable-9b091d54444c6b6512903ce6758b841b1699c5bf.zip |
r8152: Fix potential PM refcount imbalance
[ Upstream commit 9c23aa51477a37f8b56c3c40192248db0663c196 ]
rtl8152_close() takes the refcount via usb_autopm_get_interface() but
it doesn't release when RTL8152_UNPLUG test hits. This may lead to
the imbalance of PM refcount. This patch addresses it.
Link: https://bugzilla.suse.com/show_bug.cgi?id=1186194
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/net/usb/r8152.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 726fb5561a0f..4764e4f54cef 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -3960,9 +3960,10 @@ static int rtl8152_close(struct net_device *netdev) tp->rtl_ops.down(tp); mutex_unlock(&tp->control); + } + if (!res) usb_autopm_put_interface(tp->intf); - } free_all_mem(tp); |