Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp269493pxt; Fri, 6 Aug 2021 01:20:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWaxYsMwsMILfyZ05WCm8g9kspUrCn9606P256+h02MejOEdO/AhagCy2z/gEMUVUKANB8 X-Received: by 2002:a05:6402:31e6:: with SMTP id dy6mr11471273edb.36.1628238014699; Fri, 06 Aug 2021 01:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628238014; cv=none; d=google.com; s=arc-20160816; b=Bo+BEtMOcarGYXvSYVjE2G9TaV32pRSAQ9a61CiPBcN8EwH1wJMsRamaYTpJU37WfH KB47ZST3XDVPS8Yg+Woa5coDOsbpZyKAJk0qekqwzDaTo+ryMaS0QTjxON6X8qCWP6eV Jnk8s+mquOXbc3IjnpKHRqESxGHpArhZY+RrReZ3dOZDzoz/ymiWIN6gv1pusK8cjlVZ z3n/yGSiVUmxHzLhVYA3z8L+BhilG4v3SbZN3DrhjzGhr+NlNTtU0HgkX/fFr9Qu+qaP kInZtck4ddIJmk9zW6p7HNMIXf/eD2Mty3KbWRmyzrHuXdYO1jcxrEq4gGM7R50Ux0aL TYIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6cpzxGBdntOzk/GtQTOdiip0VkccUm58ZKOGOUfq3eI=; b=IHaFp78sFWEodxPZiTDKsKejAakjA+HOHTxbhE1vezbrEQqbd+DA7FMS8Eb0bWcSwY l5Oox19lpuWspITMhUPeEd+Is65hnGYuRRmWPVC0ts+KSLBXLVl1SoeHosNBK599eonU rQ6G/y7YT8qg3lB/4/ZMAqY+MpaBxJ8EHZKNaIKWXG0rDzInVXFv/tZsoxdsKmNYJi0E xr1CD96igq6dIdvVaxBHA9wNCGidCtnODgw3/xfecBslOLyodxEPG+F0m77kgUQwMXge HGI+2F9WW0Sq+pZ00ddkshrRadjIDmDSLHNdw9ikEZ+5am0c7V/WNO5k8dwjyGWYk3fO wlkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PDbpZr4u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si8207095edv.339.2021.08.06.01.19.50; Fri, 06 Aug 2021 01:20:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PDbpZr4u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243789AbhHFIPr (ORCPT + 99 others); Fri, 6 Aug 2021 04:15:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:44832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243731AbhHFIPR (ORCPT ); Fri, 6 Aug 2021 04:15:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 98D17611C6; Fri, 6 Aug 2021 08:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237699; bh=oPvlV2NsK4f1ssaKBVn25F6huJX4K96v8zrnFjhoR1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PDbpZr4uZHWzi482ob5BNwJezj2jvr0JA+yCE15kG8mz7ziEkpTYs4H+PbO2f1T6J AGSvu/G3rHfwxVSu3U9NhfqzJz+Gm080OcgMiXUTOJPvbgXsDwB1rS5ykDhdcAARHi RwiH069EAHTi137CZS6Mj/KKFMjyFkZ7p5NAHYTM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 3/6] r8152: Fix potential PM refcount imbalance Date: Fri, 6 Aug 2021 10:14:35 +0200 Message-Id: <20210806081109.047228695@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081108.939164003@linuxfoundation.org> References: <20210806081108.939164003@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai [ 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/r8152.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 5baaa8291624..ebf6d4cf09ea 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -3159,9 +3159,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); -- 2.30.2