Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2472683pxj; Mon, 10 May 2021 03:57:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR0qWDE/HwDrPegDivCwuHua/ajFpELNEalPeIgtBO2g3NEmQSya5LdlLcAsgGqOHtEe4j X-Received: by 2002:a92:cb86:: with SMTP id z6mr21425337ilo.35.1620644268983; Mon, 10 May 2021 03:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644268; cv=none; d=google.com; s=arc-20160816; b=Rr6yAUDOf/QsiAoUXjWBnQxGrFMJXcbn6+0jwe1Se7qDCbBtJdiVWokMtGm60F1gjJ vCOrd4aIQYL5sgNmH95QDmAhpeU1K5JoJsedhKIe621ywRwwNjj9KBtwLulEzRwPsLcG XllJwbXWkt/wDmElsv3kLxREjH6DmFuYg/99nb/ksAfUh8R0Gi6RIw/BWXEFxxAfs8a+ 9hh7JRYQxWP2bRi6sHe3irwV7/zqr9utscrgBBD2ZhxFTGfBbLdDMW6IFc4pQlrfrpfR oTpWzF3hqUtFjMysFTCabG5EtvdWv01TMeef23DfoPYSWaHWZbGoHXQuRU71Qg+2zUAa ZsGQ== 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=EwAfJ6w885IKRALZA8WJA16cZ8qX1z6JJSXMG6qSrUU=; b=GE9aIT7JXWxNXb9qsL+tkoGJiw977O340zfk5hNf+jdauwDfqJXrfGiZwnEdHJrWnb +q4EyyCEF79aLKUL/MUejnRzkPzO55DUAY12tv+lHzizHrePdkSgdL/MtjbkgNMcTbZc 4hwTgtttAlpGK0kZMx1Qn1gGjcfyx5oM6iQqzRk8VHTTRsuzwhiRu5LKasw2KJYZ/oZF TIWoC1mv/DZY9I0kbUvQPexrr3Pts9lDzzZSSsqJJ/i/yicqp0Tx/8oDV0mNpTNkiy2K vz7KuxFusT1tD34gYe6omJFqf15JsjjhSaKW64uzGXzgGqfi6VWbc4hkgFZtTt+TaSRy RNhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r7sTLuIv; 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 f12si15070289jas.117.2021.05.10.03.57.36; Mon, 10 May 2021 03:57:48 -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=r7sTLuIv; 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 S231773AbhEJK5j (ORCPT + 99 others); Mon, 10 May 2021 06:57:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:59296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233139AbhEJKpO (ORCPT ); Mon, 10 May 2021 06:45:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5685161581; Mon, 10 May 2021 10:34:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642894; bh=8OtG/F8cU+J7mfuCZ/3SGDj8rPkvLtAgPnVdD02rLjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r7sTLuIv04GBcVYw+cfh61lGSY6Ek/GVieOE+Gkj4SKPrID34eNWDwswiCdG/ETdR I8BEQFXB5bIqoIyMXnXOgqxFHphOoJprJdayrhDJpEdaN6omn5Op98Fw/8ir8nElx+ P0Avrz4iV6TrJn1/Cfnyc68FdOvITgcdZeb/aSrU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Bixuan Cui , Sasha Levin Subject: [PATCH 5.10 096/299] usb: musb: fix PM reference leak in musb_irq_work() Date: Mon, 10 May 2021 12:18:13 +0200 Message-Id: <20210510102008.110253940@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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: Bixuan Cui [ Upstream commit 9535b99533904e9bc1607575aa8e9539a55435d7 ] pm_runtime_get_sync will increment pm usage counter even it failed. thus a pairing decrement is needed. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot Signed-off-by: Bixuan Cui Link: https://lore.kernel.org/r/20210408091836.55227-1-cuibixuan@huawei.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/musb/musb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index fc0457db62e1..8f09a387b773 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2070,7 +2070,7 @@ static void musb_irq_work(struct work_struct *data) struct musb *musb = container_of(data, struct musb, irq_work.work); int error; - error = pm_runtime_get_sync(musb->controller); + error = pm_runtime_resume_and_get(musb->controller); if (error < 0) { dev_err(musb->controller, "Could not enable: %i\n", error); -- 2.30.2