Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp174395lqo; Tue, 7 May 2024 16:40:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXa5tMQibXJiXwRIJo/KsTBGVV09NpKIJnxMyFnCoWls0ZpDPOjh1syIEbFfntMSRM9V+Y71Q+DctoxAgCVh23wdHvQdyt2W6QQje0/tw== X-Google-Smtp-Source: AGHT+IF5LKJDWje7Z0ual8r3iEKHd7zDncJEP8AZqwnGz5KzVY6G+uo1JfZedKE1zueVuUfbuCWV X-Received: by 2002:a05:620a:1a29:b0:792:a252:befe with SMTP id af79cd13be357-792b2551e9cmr213915685a.38.1715125259211; Tue, 07 May 2024 16:40:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715125259; cv=pass; d=google.com; s=arc-20160816; b=PgCI/k8VNp0VjYmeei0YYiC9IRbjStk0ETJ85kiIO6Y4epqQvjQCcaSDScyTs62BzV 0gM4w9FVPSDQUIuySLTOcDMO5kufpqBGjf+q90U3jQjtpXfcSNFyun7Kv187OlIDdeIR OFgJkZHzeCJcvJU2HhK2eKjjbx4rTrSrVOjuyqqsSrVEw17b71JSXsXUXH8SAI8S3s64 3IibYgCTr2tBgnU5uIqOZkFWWFcq+0rdjSLfJW8V06ULA/5mTdrHmlY3Kg8ogUdAI//5 ewoqlYyzu/Tefcu4OKQc1edxkB9FUOuFTVZqYkHQ4SNJSm1XRbBrZoRz1W1rOH2cIHHL f0cA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VlW3z6f9Qs5xUNclGSUGZrO0pReRukjiV0O6PmoC4ps=; fh=6oRTMOMqoHzh8rgmvOuQOID8wnoIu9ZHoeoSNI8JEig=; b=SK1oxuMu1llJBCdbEnxSKQV4v0lWJpvstFHhZsQg2sjFfaV6i6gC8E54aCqf6aa/YK L8GraLCuy8QBXoRQRBoXzHECYInbt0rFinWE/+F5FtRlIYOdSG0a61BgD9/OuxWw8Ztn D9OUUobGh+cBUACYvcV/xFtXaOl40VVp7F8zfDYIyMEfzpMqVUU5uDRT9bxzvGY2POkC A6P0W5F4PhO9yBlVrr6ZQ6fj7fVxpJKZZyeVZbyb+FG6RKk7yqMNQIw/QhB06Jua4jmZ MnZoGeKGmH4nhPndYPBCyXdFh9YdnAFDAaNvxVO6nEyw6XybIHTdwe16NAkfWm8v/K+7 jLeg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=McY5wBn9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y8-20020a05620a0e0800b00792925cef2asi6835691qkm.146.2024.05.07.16.40.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:40:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=McY5wBn9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BB8A91C232DF for ; Tue, 7 May 2024 23:40:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF942155A34; Tue, 7 May 2024 23:11:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="McY5wBn9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFC7216EBF5; Tue, 7 May 2024 23:11:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123482; cv=none; b=cxidTRWZvxm9d57srWtCf7xbXkUF6UJIW25OAhTYiKQq2UcgoH8EtBMzH009Ivfqr/Mos9XK/l84iYVVyioYQPtCHW0hqkhOvZuyaaz3j3XKrRdudOv1bJlm59EgPGkoHUKq66vrSIis7ETGJz4zc44mcXURRTz5Ls8QcQLwbMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123482; c=relaxed/simple; bh=J1X4zuAtY0+5rFPUi5kT3JJvSZcfd582Gxlh8pfClnA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kr6nNrh4+q3xEzJ+faTBzWEW0q1yVotRud954FfRJ9TiFZ/fPjy+aP76MI9lLsJUcSz0jQpNXiYuI3aZ0UXbOxlH/bsXSJrMWOJh5J5paXOB+rrOeHWudIhrKYJUVKniSbeg5rnaznG/eFA4YX5cbMXuv8l7LUudQJ+Iv35u91o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=McY5wBn9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C3CAC4AF17; Tue, 7 May 2024 23:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123482; bh=J1X4zuAtY0+5rFPUi5kT3JJvSZcfd582Gxlh8pfClnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=McY5wBn9HW8tMT6BXaXpVFeGdgzx9mJXdRwCXQq6pA3XfPvogpIH7EhsEvpFrZtSH xwGmLgQaYIIlxX2X71GruleQhWP8nzfbb/qUU9/0+0a7dUJjYCf0Qx1/aJrAcrdCvC daWSkyNybKi37NOyHQtweNvYPlkw52cVQVhAbqnlvwm1gq7iZt1gU7JtAGIWrtTwgL w/BsPftjcvOA4rYQDQAJEpBD3OZeJ1xJ7Zr//hPJ3nXsMJrdz00LA8KwFfjL36/zie 626vsqT/smHy7VDbaBNflYEt4s3uhe31V2CXggSVDNeKHgiRNuZUxL23I5lW4eo3ws Neegf+7PAFPIg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pierre-Louis Bossart , Mark Brown , Sasha Levin , support.opensource@diasemi.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 26/43] ASoC: da7219-aad: fix usage of device_get_named_child_node() Date: Tue, 7 May 2024 19:09:47 -0400 Message-ID: <20240507231033.393285-26-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507231033.393285-1-sashal@kernel.org> References: <20240507231033.393285-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.30 Content-Transfer-Encoding: 8bit From: Pierre-Louis Bossart [ Upstream commit e8a6a5ad73acbafd98e8fd3f0cbf6e379771bb76 ] The documentation for device_get_named_child_node() mentions this important point: " The caller is responsible for calling fwnode_handle_put() on the returned fwnode pointer. " Add fwnode_handle_put() to avoid a leaked reference. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20240426153033.38500-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/da7219-aad.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c index 8537c96307a97..9b0c470181706 100644 --- a/sound/soc/codecs/da7219-aad.c +++ b/sound/soc/codecs/da7219-aad.c @@ -671,8 +671,10 @@ static struct da7219_aad_pdata *da7219_aad_fw_to_pdata(struct device *dev) return NULL; aad_pdata = devm_kzalloc(dev, sizeof(*aad_pdata), GFP_KERNEL); - if (!aad_pdata) + if (!aad_pdata) { + fwnode_handle_put(aad_np); return NULL; + } aad_pdata->irq = i2c->irq; @@ -753,6 +755,8 @@ static struct da7219_aad_pdata *da7219_aad_fw_to_pdata(struct device *dev) else aad_pdata->adc_1bit_rpt = DA7219_AAD_ADC_1BIT_RPT_1; + fwnode_handle_put(aad_np); + return aad_pdata; } -- 2.43.0