Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp403333pxb; Wed, 3 Mar 2021 06:17:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTeodx54/znEHWutLw5GIfOWDUq3e+1vNzkyjR+uV0Nw66L42ofgGiiNKe7UIb5lEEtn3O X-Received: by 2002:a17:907:ea3:: with SMTP id ho35mr25440913ejc.396.1614781079210; Wed, 03 Mar 2021 06:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614781079; cv=none; d=google.com; s=arc-20160816; b=rq90KYAI391z9KevTIBekuq7cmBuOX4D8/iT/SLiYJL33zaroGlHPgh3cBaT0597TA z4TGRB53Be2Lyko3F+7hKUhshyDCkLqabLR/KTyQfzfof1H545oyXEU7eAwYpRvmhDuV N+CHZmEz/MQ9SdmyJpkyrWC4h0NjCEHORMrIy+IKXOpIdwv1emxOBi85gLHATgPLnb22 wzf5Dp9fpa2N/AAyT0Od3uLJXpQIgelFzRBES23grn8SpEjZfQmNLQSXaw8rbpAMWTRA TxoBA6p2+fuvaQMMzCaWzA/4cdVMjZh3NW1riCDaCchRX5WYm+yWQk79nxeYJvvH9w/q P6qg== 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=8i82lhoyl9ujgh0ql8znCPPzfTkJIcihU/PAJRnyy7M=; b=LQwEqWkiH9bZcZGkqL3LnzwiaJ+FqfdECmpSSjXDn1JNNVrcBRWE9ypwxBM5Y1jtXo bkXg+cDBqeYgvCKASey8lsiH0wXxSmKZZnikugYOh6N8h719+nEI6XL1htwCYccXfi68 x5XS/hj+OFRGgZPnONrtXFGyIHf1OGBi+3vp0sfP5wp+usPz9sBsXYCb4lM2OGY6IGVl hejrtvUmg84RcIVwZcHUxRz4ndh2IQ7+GkAEyNNZRV8axDd4x9x7NuhtDwsbNvjJKoJ5 RN1bd8ZXIRPigPQFNQ9elHEF4reEFz6qtiaQYJ5V61vlmqrVbgL4Te/J+Uo9JzxPAhIU 2HNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eKnVAF7g; 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 g12si9050325eds.274.2021.03.03.06.16.29; Wed, 03 Mar 2021 06:17:59 -0800 (PST) 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=eKnVAF7g; 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 S238441AbhCAVAS (ORCPT + 99 others); Mon, 1 Mar 2021 16:00:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:48192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235031AbhCARLS (ORCPT ); Mon, 1 Mar 2021 12:11:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D6AB864ED5; Mon, 1 Mar 2021 16:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616973; bh=53mBfy1vcp9FbnQIhLrFfcdHyHHokFUZHGDlVa94bhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eKnVAF7g8JwqlfB9qcXXrrAa4mVmzRMEF4mPAuU4p43aqb4gCkJTiRZEGFe+iKBWM 5pXJc277yRHZ6p5RQval+K8jG/w6rgl+habMrVYzXAbZjrKRAVxjEeDXCj1Cxe/h6/ /bPPLbxOBRhvni55G+1TP0zpPBxRhR7vGxtcctiM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Mark Brown , Sasha Levin Subject: [PATCH 4.19 128/247] regulator: s5m8767: Drop regulators OF node reference Date: Mon, 1 Mar 2021 17:12:28 +0100 Message-Id: <20210301161037.942433857@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@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: Krzysztof Kozlowski [ Upstream commit a5872bd3398d0ff2ce4c77794bc7837899c69024 ] The device node reference obtained with of_get_child_by_name() should be dropped on error paths. Fixes: 26aec009f6b6 ("regulator: add device tree support for s5m8767") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210121155914.48034-1-krzk@kernel.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/s5m8767.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 667d16dc83ce1..7ff94695eee72 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -548,14 +548,18 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, rdata = devm_kcalloc(&pdev->dev, pdata->num_regulators, sizeof(*rdata), GFP_KERNEL); - if (!rdata) + if (!rdata) { + of_node_put(regulators_np); return -ENOMEM; + } rmode = devm_kcalloc(&pdev->dev, pdata->num_regulators, sizeof(*rmode), GFP_KERNEL); - if (!rmode) + if (!rmode) { + of_node_put(regulators_np); return -ENOMEM; + } pdata->regulators = rdata; pdata->opmode = rmode; -- 2.27.0