aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/r8152.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-07-14 19:00:21 +0200
committerDavid S. Miller <davem@davemloft.net>2021-07-14 14:57:55 -0700
commit9c23aa51477a37f8b56c3c40192248db0663c196 (patch)
tree896f87c1ee99a0b534600f1ea5fba1683ec92f37 /drivers/net/usb/r8152.c
parentMerge tag 'net-5.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (diff)
downloadlinux-dev-9c23aa51477a37f8b56c3c40192248db0663c196.tar.xz
linux-dev-9c23aa51477a37f8b56c3c40192248db0663c196.zip
r8152: Fix potential PM refcount imbalance
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>
Diffstat (limited to 'drivers/net/usb/r8152.c')
-rw-r--r--drivers/net/usb/r8152.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 1692d3b1b6e1..4096e20e9725 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -6763,9 +6763,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);