From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796204136; b=WT2eQgO5+nbBGMivG1VU+tmEWh1OP32mZz25GB85A8TPdG3tOdoUPhEfwjCqyt1DMgnh UE1obPQiJAy7o02Ng40ris17P4c8yNQKPfhH6pU2BPExH2E/eeVComwRafKsBAitrlBBE 08CcZNtAk6tu0sq7/+4pOd7VBpR23/q3I0bjOu7alv2UJXIj1uuqbQiuvf41bAWtDBdL1 C5RYiTkGmJDLuxYXucFqG2c6ZtKbG1Xfmggl7iDHI8EANmBPKFLnkqd0YDhXxYRmKaBdF 6gPLh/SBeaVnhhPNiRfuUiX3rnCZKg/qkIvL9yactQxRlFc/PpUryS+RR7vZqt/xNIA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796204136; h=Received:DKIM-Signature:From:To:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=puxP4L/SeeRNsBHedb4B4FYwpC2zGOUMezd9x9RoMYU=; b=DAxEb6kqkCXL8neHYbg5OD6vnslEyi+bKeOq/oQR/sjTqUSWTiYD2KrDmLnho2bqzvHG Y8hNwqjAl3HblLwF6SIVOjwm4smP7S/IKEB2euJExH0Wnw9Me7P5bPuoEE5f7KkNK0z/F x7MyPclz6tPJh3baeLLRHkg68tZzr/mSOJuFlBdJfiozhwxb5pYEeQ2S6LwYdg6CNRv3K JOI6N3rW5S2A76xDJ4nVWq7SToYKHikOOWrwzGaIcFxTHwMkgKA5F/csutIlsehK0oRsm ScqOHiwt8BJa8JYj7Ug92VqX7/P2+uITu9oUzRmGnDqdLALVFKzf2ETTmegaLitsKPQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="L/0UqKDz"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59EBA606A32C for ; Wed, 2 Dec 2026 09:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L/0UqKDz Received: by smtp.kernel.org (Postfix) with ESMTPSA id F03A21F00893; Wed, 2 Dec 2026 09:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796204136; bh=puxP4L/SeeRNsBHedb4B4FYwpC2zGOUMezd9x9RoMYU=; h=From:To:Subject:Date:In-Reply-To:References; b=L/0UqKDz1qQvlRQUnmQFkmld/lUNTr6Njx7wNcGpTB3cki93GQGOW+h0Xavir+pMG lDUM7Iv5ekGCJqt7PFs6GEgdXRkWAMlRo/XVip82f8n1yo7ifJEDgdoEPY9ssOj0yp 3Q0UvjOZPD3di0rbGQfiMxUSe7WaKb3sqfWIavSJhKRymRTtzyPTRxEnX80SVn267b yrrtKpPEtn6VauJQnHzmilF9RgLr6pJ5DwrmI3clCVkYHu/JB4jYapYvYRbhIVM5/w e5tqKLaJjB2J80q3LtAZhO6W3mwRM3L9IykDpDbhsvq815N313sEapMkjcy9ln3c1w LU+x1Y+Xew91A== From: Lee Jones To: lee@kernel.org, Santosh Shilimkar , Krzysztof Kozlowski , Aneesh V , Greg Kroah-Hartman , Benoit Cousson , linux-kernel@vger.kernel.org Subject: [PATCH 8/8] memory: emif: Clear invalid custom_configs in get_device_details() Date: Wed, 2 Dec 2026 09:33:55 +0000 Message-ID: X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog In-Reply-To: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit get_device_details() copies the entire platform_data structure, including its custom_configs pointer, into a devm-allocated copy. If is_custom_config_valid() rejects the platform data's custom_configs, the pointer is never cleared and subsequent driver paths continue to dereference the invalid configuration. Reset pd->custom_configs to NULL before validating and copying cust_cfgs. Fixes: 7ec944538dde ("memory: emif: add basic infrastructure for EMIF driver") Closes: https://sashiko.dev/#/bug/linux-aae546d8-c18b-4dce-8ffd-052d75f04a47 Signed-off-by: Lee Jones --- drivers/memory/emif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index cb2c49028d6c..6d5a74a0ab8b 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -1040,6 +1040,7 @@ static struct emif_data *get_device_details( * custom_configs is not very critical */ cust_cfgs = pd->custom_configs; + pd->custom_configs = NULL; if (cust_cfgs && is_custom_config_valid(cust_cfgs, dev)) { temp = devm_kzalloc(dev, sizeof(*cust_cfgs), GFP_KERNEL); if (temp) -- 2.56.1.911.g883d8bcb20-goog