Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2656307pxj; Mon, 14 Jun 2021 04:11:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRliQ1ztIBfjvoFG0J+Zpr9MapB2+NK1Y56hLgPvxP7s/qyzJBhvKqbxGS+zF0uPXFC5ic X-Received: by 2002:a17:906:b2d1:: with SMTP id cf17mr15073393ejb.225.1623669074763; Mon, 14 Jun 2021 04:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623669074; cv=none; d=google.com; s=arc-20160816; b=KdYtOYeQ/qQh1NsmF+c04zzGHek8CP+aghFI7Y3x6gyxnmov1MVdI1K/3H/XGYPF1s HThZI4lVAxJKWt3GvbnsogLdDFZXoRYmlhSBo/K+upAfmuN3/Y84yIKlZZvqijzZwsfe 3PScJK+yi4vkCwkWK7ue/lV3r7DWh6HnXey+DUQ+Nw+IpOttu4eSXdX5OzRHLBz7zXVE XC8uajjYUdCBK2MxGzqiHDgEoYmbVTxDDyny/ZxKlD9LbMLAP1ANglgn7du6QFII5C5H g4x4uPj4KE7UNrCSVhdfXVlJwg6sNWZYtXbQFMO8HsbnhSqyNwDC8m2FJMKZp2y3v5Iq /C3w== 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=f14xTIVGJnfUKs8VEiznYIQS6fal8CHET2btuQ0Fz1E=; b=oze1zgcGLy6uscFEeQXQZd2aR9FHaaEPv//PhtgeQC537JJSZ8/5Jrl407kYoGw1+q FiODelMolTdI4DR0cxtBfKj9a59hdi+H563617hYzCfW/wzVUYfDZJ27YzHCPJUr8bpT cA/2MPXC0Ks0J3WEPKk1K24pq9AZUPT8tIpQ+roQJpxn7ldoBSLL5AY3Jr6tLbYEIwn+ tIMxX487ahU2YOrpAN3CUmL9b68iIppLoMRQmPSvrlagBNOKSn9qUw0hVsUp/n+hclHq QEj8tp4zPOUr5hkrhmOVNjphHKxcrCeEerdvfNLxPrnQSp6+NZ/ycBL2PCM/2rp5xVyV aCuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UPI19vPN; 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 cb25si10579994ejb.709.2021.06.14.04.10.52; Mon, 14 Jun 2021 04:11: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=UPI19vPN; 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 S234443AbhFNLLV (ORCPT + 99 others); Mon, 14 Jun 2021 07:11:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:36242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235135AbhFNLAK (ORCPT ); Mon, 14 Jun 2021 07:00:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B07C061436; Mon, 14 Jun 2021 10:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667364; bh=FNHdvV5gRfdkfTmM6T5k/QAZ8L1tj0CITsaPmdGBSVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UPI19vPNA556nMluWv3ZVyXxYPR45DuTtdbPFQPAQK00dL56IEy6jybzqudWdvMzs 1lZGT5P2Et8F2gINfopbNJ23sapCbRpyvrg29qbao5J5uqQqqgCE2ixzWvi8PAs4iR +9k4ikpbtxN7ufWb3xD/DSvXbHU265bU3RLBp3xA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Peter Chen , Sasha Levin Subject: [PATCH 5.10 008/131] usb: cdns3: Fix runtime PM imbalance on error Date: Mon, 14 Jun 2021 12:26:09 +0200 Message-Id: <20210614102653.259267236@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102652.964395392@linuxfoundation.org> References: <20210614102652.964395392@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: Dinghao Liu [ Upstream commit 07adc0225484fc199e3dc15ec889f75f498c4fca ] When cdns3_gadget_start() fails, a pairing PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20210412054908.7975-1-dinghao.liu@zju.edu.cn Signed-off-by: Peter Chen Signed-off-by: Sasha Levin --- drivers/usb/cdns3/gadget.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index 0aa85cc07ff1..c24c0e3440e3 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -3255,8 +3255,10 @@ static int __cdns3_gadget_init(struct cdns3 *cdns) pm_runtime_get_sync(cdns->dev); ret = cdns3_gadget_start(cdns); - if (ret) + if (ret) { + pm_runtime_put_sync(cdns->dev); return ret; + } /* * Because interrupt line can be shared with other components in -- 2.30.2