Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp170266lqo; Tue, 7 May 2024 16:29:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW60IG5BIg3VvDLjcBdYnI4QAy9KF7Iiacl2rtfLCPDDWKhGE81FIzlvbKN4UqmhaD6MDeXZQNKUQi3OimUjcjB1iXcqhHfac+HtlJw5A== X-Google-Smtp-Source: AGHT+IHRE7qMO5mBYSQbq9nKDZZejuv7r57qGwQCIig2XbU+XwNy+/GoIQ8E/vxT50DCSJn3LUe+ X-Received: by 2002:a05:6122:309f:b0:4d8:7ae2:107 with SMTP id 71dfb90a1353d-4df693517a9mr1015434e0c.10.1715124579405; Tue, 07 May 2024 16:29:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715124579; cv=pass; d=google.com; s=arc-20160816; b=fhmNwloH1PqKzqRqEIeRU28j0+8on0F0dTwM6TiFpKZzFqgJMwxQ5tc+E08gFM5AUD 7i7GiEgFC3jYK2iSqp+/BW/Lffo8MZxObc9Z1Rna2oAeyu41ryQXgsORjciYAOyViwNn oC0OnNNIE0ggrHVj4fHmTMk696sRBXhEPyzitJj+HOORLegqgZ9mMqe4SLtQo2tVxJIt ctVS56zdw2TLnR8hofUeGbQ/3PX9CnhlQ5gDYF23QVPiB9O7K3iQ+fEdYXbV+jVK3yfS GNKRl5qzNfYMFSXjwXBws5/ETx2ErvZUKrlu8j5QwwLBumymgsG+mj44hhdSZMjDJ3o2 lblg== 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=GchOCLnZbR/3LmKs24kzS4M26/n9pa6ClfnDnCnCOVg=; fh=6oRTMOMqoHzh8rgmvOuQOID8wnoIu9ZHoeoSNI8JEig=; b=d2W7flbzTYbE9GnJFZ+sPvtDLoJ7TIkcdxoXjUZ7HREyMb2I6igWm0xHEMjWg0Xdds zdlCItM9BxCvVsMNpz30nvhZzgljKbz4z/Nzf1EK8wPzKSmDMSwFQuDYuRg/3HVyhGhV pvjR8mLj0Yj47S9wenNLGvcPXfd7ntGEUgVYzjndpTl2b3seviJu9eYosPI3JlYM28QL V1NFDNiyXISvcPu9PqsAawggODmu3n0GQy5TK4oFteRhpYUPLrDuOc2V6FXclFnQ9Y+a brZDcBcjaMqVV00QHO22bQvbwZRTuUlwrbGtJnJayOgCO6BBLVZjXfKelPTlkFoX66dh wcNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NOw+Nm6W; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172373-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172373-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 p8-20020a05622a048800b00439ac5225b6si13159663qtx.349.2024.05.07.16.29.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:29:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172373-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=NOw+Nm6W; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172373-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172373-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 1FCFE1C20B43 for ; Tue, 7 May 2024 23:29:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D678B1353FE; Tue, 7 May 2024 23:09:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NOw+Nm6W" 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 04B9D1428F0; Tue, 7 May 2024 23:08:59 +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=1715123340; cv=none; b=KqDYgK5/oMkxneq/mdvRwT14ZTarbtLjF9d0Xv75olSyS1xgJ92hwSIvIiUXb+vnL7LLpjYJFek+JnwurM4wtKzBJkOaLv5LUhQhHzBsV65IqLhhIgLWmH2R3SyQOcOj1ILh33ayfMHZNK8BsRxMcIl4jO2cen5Yzy2CS9cT1KQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123340; c=relaxed/simple; bh=OYk/SNP9waEvg4CJG+FcCKBNcvA+ivNahBseQJQNfLY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EC8IvJJhR6IglZTNxit6UJqcZ46JLkClgjKVVsXuBDShacnEKGM6Wq3jMiqnG1aRdw1hhAHAf8tKDlT0WEpteHtPAD9X/S6Pu6aIHMm1hdkMQq+TmmW+Ys6jeIoLKQkmJiHBylHFRcvmJRUX7OzJeK5TbpTOWkjnd5EDCAB6P1E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NOw+Nm6W; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74008C4AF68; Tue, 7 May 2024 23:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123339; bh=OYk/SNP9waEvg4CJG+FcCKBNcvA+ivNahBseQJQNfLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NOw+Nm6W9KXanPK1YtDXRntVZR8K3BCNhpAlqqkFetjIGtnvyNSYJaTuuEwBEYrHn +drlawEC9illhYr5/xpYfUOwdcgDwDX2ewH4DRLMNoGbXQqWQAHB4P+r69uQfbPlWg LhmSx1U/ZGqDTr6f3p/QEhoxoFemI7ocNu8vCKOTpMeCsiWwHvYaoK3guFcCD42cPL rm60wLW60V/SJoJpEqWeekSRK8nb/9I1lPleReAg80RqZzxfpfNt56Iz+aztGaaJxw roxR6HPy1aTema1Ads6MaJsd1G/M6NIy+Jfut9UIk9F4RGc885J8w1Uwmt88B11Ya2 FtXSCAD2ssidw== 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.8 31/52] ASoC: da7219-aad: fix usage of device_get_named_child_node() Date: Tue, 7 May 2024 19:06:57 -0400 Message-ID: <20240507230800.392128-31-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507230800.392128-1-sashal@kernel.org> References: <20240507230800.392128-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.8.9 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 6bc068cdcbe2a..15e5e3eb592b3 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