Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2662042pxj; Mon, 14 Jun 2021 04:19:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpta9xXdERcZpmOijxt2t9D9avQ0H1+9kD9zsMbFyj9v4WUu2de/J5BOL+O7N25UfbQZQ2 X-Received: by 2002:a17:906:68c1:: with SMTP id y1mr14835978ejr.32.1623669566339; Mon, 14 Jun 2021 04:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623669566; cv=none; d=google.com; s=arc-20160816; b=sgW+03LI1JULZVhlvJ/Qhtuefx5uB0vJK6gX7aFBkdvFKsZtWbvTauSox+jkajojka fCNFHDS31i9HTFZ3sWUpGkU4l2agLKNLQQ469icsqgRs1h/AiiW3nAYg7N0ydKnHpf+9 U0z4QVFxp+Uf6qvbhR6erMWEddI+ckSc9GYsK9fBtIssY5yf1GiXlDBzuUysXR0urjEs eWBv6Nb/0jk3KKmwP6WBNcY8V9DpuUR7ZROm+o37/3UzROhfbMuAE7KpY33h63JKpmL6 KnWfffOL2CkFJUrUOFVjWaYpTvTIZS/xq1NcRKOQ6rQ6pSyMA9BfVgEvc/9sOllGHwjC YXmg== 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=7grOvh/EmYdilRkAlL/yGN3YhaBhOYRGd9ZilOCkPlw=; b=Hyf3iR9DK8oAYVU4aA4ZIMJJaKy+RQR0wBzB28M2GXShFa8kWjG5+npA2ireXKrS0w FZpawqMSmxj6Dkd0QECTUYy4lnOYpzWLhboJXP+n+cnpy8x7AU9Nh+Pp1FN7KIWFYzXm 06T7Rh05JTBBvGdOMqaEXHMs1gGIssHAI2pC2dpLPOVG1tpLTBQ2vqjmz3dCHZA/FzpH Xy5bjriU+NExoUY8nKaOGl+lJ3pZt+dIHvzBf2/qCXbwzyYMr4dTnnLM9iXbNrT+pfAw GEbRutsSox+a1S21hrr62ngDgMMqLt8O422qj+Ja0yLKnemhcgpUcyPrvDv5z3pGzt7L XpGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J6LWAgJi; 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 g8si9134523edm.527.2021.06.14.04.19.03; Mon, 14 Jun 2021 04:19:26 -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=J6LWAgJi; 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 S235118AbhFNLRA (ORCPT + 99 others); Mon, 14 Jun 2021 07:17:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:39116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235119AbhFNLEu (ORCPT ); Mon, 14 Jun 2021 07:04:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A609C61921; Mon, 14 Jun 2021 10:44:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667499; bh=wxZ6nuSNY/Cfnc5zRh7hFW3LIgNWXwEOgOdjmfO6Q/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J6LWAgJiziCJV39heeahPYkIuqHwDgQhR169dUqMMiE13OrIutnwSQvmEVgVTI7mz 6SdByY+ZYhkIKCBMBHun6HTCrg5+si6OP6IWQ0eactQuKao4M+2xFCKynXUzXr2d0j sxw6XKM62c5L0X0+4WyyPCankrjgy9qsfcUQif6A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heikki Krogerus , Andy Shevchenko Subject: [PATCH 5.10 078/131] usb: typec: intel_pmc_mux: Put fwnode in error case during ->probe() Date: Mon, 14 Jun 2021 12:27:19 +0200 Message-Id: <20210614102655.680524233@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: Andy Shevchenko commit 1a85b350a7741776a406005b943e3dec02c424ed upstream. device_get_next_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. Fixes: 6701adfa9693 ("usb: typec: driver for Intel PMC mux control") Cc: Heikki Krogerus Reviewed-by: Heikki Krogerus Signed-off-by: Andy Shevchenko Cc: stable Link: https://lore.kernel.org/r/20210607205007.71458-1-andy.shevchenko@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/mux/intel_pmc_mux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/typec/mux/intel_pmc_mux.c +++ b/drivers/usb/typec/mux/intel_pmc_mux.c @@ -623,8 +623,10 @@ static int pmc_usb_probe(struct platform break; ret = pmc_usb_register_port(pmc, i, fwnode); - if (ret) + if (ret) { + fwnode_handle_put(fwnode); goto err_remove_ports; + } } platform_set_drvdata(pdev, pmc);