Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2456215pxj; Mon, 10 May 2021 03:30:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz38LHggWUVlrlxQbrbnjiIjraVSosN2LbQOKxzfxHStT1AwbNdxUQ1ai6m8+xjDhFRSBPm X-Received: by 2002:a05:6602:2492:: with SMTP id g18mr17469803ioe.150.1620642612306; Mon, 10 May 2021 03:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620642612; cv=none; d=google.com; s=arc-20160816; b=QRrLIQYMEhoNsAV2207gTGmAzQlaP02U32bEJT1TkR5jgY6fHP+Nl3pYUCeEQ5wOlS bLw04UqlKUeXj8cxL8Cq6qPbUNa3D5k3y/QdZL/C3xxkpo/+dTOZ87M6kOQfwticPS77 Xhb2qEwSvW8/iXO0Z94G224fvtCt/prnS7Yl7cAnM6PC9rzpKXT2ZwET6ORpmU+6SU5i OQeB765IWYxQ1ciSXh+ubRm6q8S/asWfIEda7OyQKiPvHVb01nGEy+CUBKARMiyicw59 CN26vpCpgvSGy+1ElfmhJYbjNFaI734LJa/8J8VI1bR95UqVwo42kDqil5+Q/iJNMipD AkDQ== 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=SkZeeCDb72h6MQAp1FDF1MkK/dIMSTjlGAQS2vwUHpE=; b=UKQPCoUUgkrDQ8N9dQOneJg5YHMLB09ExPHIcdVMH4xIqYJrqx3FyxnTLZ95b/8fYL j/HtO/vHJMcgKfcYYMnRQM+/GGyiQePktuPGuNDnGSVPYlSThVrSGAz5r1KdVAfPWPzJ iSiFvR/U2Rg6Fia4OZcdyDvlRQ0FZueud5WiOneGeJj/NTYmnLVxcBLIXEpjvvxICZB1 5/HTT1kHpPfqyeRup38AUgtWISBHFbOfqBKnxPN5MlVUgcyuVH7COfi8UjF7aVXzivpq ixNI5+sSWifXYYIFqENcwZxkbqFVhPaLRp1HLug87h2m8+Yt2S3UwfD3lfye2vmrPhTn bG/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TKCiNSV0; 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 y10si15354064ili.76.2021.05.10.03.30.00; Mon, 10 May 2021 03:30:12 -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=TKCiNSV0; 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 S231793AbhEJK3T (ORCPT + 99 others); Mon, 10 May 2021 06:29:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:59860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231549AbhEJK07 (ORCPT ); Mon, 10 May 2021 06:26:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 26FBD61493; Mon, 10 May 2021 10:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642354; bh=jmHrcJkeLpaMF2gfUFLZ3/4K7LZ0sMd5TJntExn0exY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TKCiNSV0FRg1at1Vkh8nqIYxrBfOv4W9Elmnd+cQU4vTCEm94a/bZ0v6/9SIk19MQ F0Ee1F0qbUVwSemYYS8B0R7EFhainrpLcSYJfAkmBunfLHy+rAz3bA0hoIKSGQngO/ cIPFcGuimBAdilkEnbSW0QeZQmKxkkGeI5hHnfcU= 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.4 061/184] usb: musb: fix PM reference leak in musb_irq_work() Date: Mon, 10 May 2021 12:19:15 +0200 Message-Id: <20210510101952.207680162@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510101950.200777181@linuxfoundation.org> References: <20210510101950.200777181@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 166f68f639c2..70ef603f7bb9 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1932,7 +1932,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