Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3526377pxf; Mon, 15 Mar 2021 11:31:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH+D786WVvidq8DzZPL62JV3q1PSbww/Y1+llhiKwHlZ9/6avK+ZAKyq9A7JdabTK2nypN X-Received: by 2002:aa7:db01:: with SMTP id t1mr31656842eds.77.1615833074428; Mon, 15 Mar 2021 11:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833074; cv=none; d=google.com; s=arc-20160816; b=Lc9YwrBLorcHVMQyUG3FSlC110YMknHb7+Q7Dzj1JJBwvbm7iG/zt5Mwv8UsGKpeQj s0jZJH2wQBdbURPLNAcT4qOEqyupMpxJFO3YM82QSAnSVm2U5okSjE1tV1Qrpy2N0LTi AN29HKiDFhc5L7ZErYKieba1sLcfBC4h5WVTtLuuK27xiU5pKxdfbyEbnnvRwsLHeYDY fHk+Qf1UAojY4nup1L+sQXFBvGDC/ZE0kDDMNJHudGElaEhHewYLahA2hNwTv1+UGmRL z1elECfhlhDWknKoEBgaIpJG0+maIDJfqCAZedDMhow2KF4hzHf/SXedkPD+mi2+TbYW Khnw== 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=Y2DF9/n2pQcvY67xgOQEvhn8UDEupMqDl3QZ4NgvrT8=; b=C9RyFexIYh4NLEsVuxCv2K4DJOCCNFJ3SXXcEs/v9xyK10dAcHKekGWhRZH969VHzU xMw1PKqAeIUiETNxPCotuq3h042Kr+fO9v6YHvRnA8fj0pci5pXUivBUM+8Y5GOuscXu fVmSlZ7Od1pu1HZ4xLLDrGAO+a890KOBmsihX7I/ON1DXJeJ9Ktx1qK9au4/PLtKPMCS PrdLGsr3xu30A3WeN8CbYe7f/yzwILpAW4cBmHw0iVOEbGb7uPGtM1NhV1NDM0+dUNpQ gLFn18anrb9KIZ6xajWCNQ4jmALvTfNng2NsqTtuOnzii8V3WyE8As36qFHDEoGliMJc yK8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="rvJj/1ql"; 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 cw19si11292867edb.211.2021.03.15.11.30.51; Mon, 15 Mar 2021 11:31: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="rvJj/1ql"; 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 S240675AbhCOOiQ (ORCPT + 99 others); Mon, 15 Mar 2021 10:38:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:48348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232341AbhCOOBx (ORCPT ); Mon, 15 Mar 2021 10:01:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 78D8D64E83; Mon, 15 Mar 2021 14:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816913; bh=qWW6GbaHmHHqcd7ZnP7yTVUcg+AdtPt/7prIndfCoWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rvJj/1qlIvcDGv2a85k7zX7nstWsd8avxFxoJz514qGZVtEdpI3GB4ZnDwl936f75 S1XJss8/xeDzyZCZFFkYbdLghNL2MMnjHDBc1kD9pxtmYRHWSxmxUbNugyrYN5ziSb GWtPWHIZG0E36ENvAs6ly/Zwua9vpJawFIU5xDYs= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Serge Semin Subject: [PATCH 5.11 198/306] usb: dwc3: qcom: Add missing DWC3 OF node refcount decrement Date: Mon, 15 Mar 2021 14:54:21 +0100 Message-Id: <20210315135514.320187939@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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: Greg Kroah-Hartman From: Serge Semin commit 1cffb1c66499a9db9a735473778abf8427d16287 upstream. of_get_child_by_name() increments the reference counter of the OF node it managed to find. So after the code is done using the device node, the refcount must be decremented. Add missing of_node_put() invocation then to the dwc3_qcom_of_register_core() method, since DWC3 OF node is being used only there. Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver") Signed-off-by: Serge Semin Link: https://lore.kernel.org/r/20210212205521.14280-1-Sergey.Semin@baikalelectronics.ru Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-qcom.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -639,16 +639,19 @@ static int dwc3_qcom_of_register_core(st ret = of_platform_populate(np, NULL, NULL, dev); if (ret) { dev_err(dev, "failed to register dwc3 core - %d\n", ret); - return ret; + goto node_put; } qcom->dwc3 = of_find_device_by_node(dwc3_np); if (!qcom->dwc3) { + ret = -ENODEV; dev_err(dev, "failed to get dwc3 platform device\n"); - return -ENODEV; } - return 0; +node_put: + of_node_put(dwc3_np); + + return ret; } static int dwc3_qcom_probe(struct platform_device *pdev)