Skip to content

Commit

Permalink
r8152: Fix potential PM refcount imbalance
Browse files Browse the repository at this point in the history
[ Upstream commit 9c23aa5 ]

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>
  • Loading branch information
tiwai authored and gregkh committed Aug 8, 2021
1 parent c98a791 commit f6a2ff0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/usb/r8152.c
Expand Up @@ -5282,9 +5282,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);

Expand Down

0 comments on commit f6a2ff0

Please sign in to comment.