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=1796140604; b=yNiywe9Q1xTotgV/loZs/iBL5nxbirvr3Evt3baYcypi2ERkFS8mBrmjp7fmaDxY8uJp 1XCJ5x2du/m0BXXmU9GrE8nfue/4HKUQNb0pajNHlCY2zVNZ48ImK2ZsVoibaIWND08ZL ob3BAYbuXuBSDgff0x8xFiEHtmBY4xxOoTV93okXs13EF290HxEwn00zGmAmiTDBKFGKw StAlwV1dba7txZyQNwvaNllHOhNstsNlkE9hFJJpQ4h0XdXwJ5zL+ufjbCXv0oBMepzAx jTf7d8DH/ma//Xu9pVZDo/q4qZKgpko1YO3LuYEoidVE4ZFiwJfrNfUadNGUMezUrQA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796140604; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=58fdn96AegqeU54qM1DwLyMwGHrQ2AcPj8apHujokxc=; b=sNqe0a9Po7/VXTw53U6HzExjSYVPdJioXSE/uztHmbPs2hZajc7F1BGVE4IZdtf4ItGb SQCxvZsy6P2Q/1DXTg0dFjuOM4v7ljF+UqZ+ivNf27gy6os+QsMJExLMKa5LAWGk9LTaO ZeqR3FuceQ91sfQZg4QpQA6V3C0sH/qd561rxU+UDKQp4OtEall5BWA18xfTqZ5khKrG0 TENtHfvLEYUlv2XwNz4ivvG/FUsx7lt258ghq4D/qNZPUuEGTeMaGryVxLxO5Yei+eAYS dD3RxKZ+X1H0pLJZtizvdV2ay/WWCt8/ENy5XU8dZtJCaT8x8IJh5AG1PT/tsgM7HhA== 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=R2sLS9Ig; 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 93A53606A31A; Tue, 1 Dec 2026 15:56:43 +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=R2sLS9Ig Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE6CA1F00893; Tue, 1 Dec 2026 15:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796140603; bh=58fdn96AegqeU54qM1DwLyMwGHrQ2AcPj8apHujokxc=; h=From:To:Cc:Subject:Date; b=R2sLS9IgGlj0AfHMxyuoxkqafPYT28qvW6eh7crEfsIHS5rvHMVXixzFSXcW6AZds eyXimbsKsE/kpnrpe//r6TUvcBrUnRsaunfY8ET1rwDrhsRpwhSLxng/CedSZUpBzR CcWLvV5RuN2ScnESCUdbt1VM1V6DoPdF2fUw1pnZgbkuAf/7vhvmvvWj/MmytNLQFF Kaf/RoR7Tw9qCErIFh7IWMfF5kYS8xiBjE/Lu6yVa4iUKtKj9c9MnD6RYkgT+PVIi9 +8EYSKz/JFUMu5FceYMG6kK3eG/RlXsMt+mXI/7LLJQsWyjdulqm8NKm0LPnAd6Xl8 iPhN6diiaPuew== From: Sasha Levin To: Mark Brown Cc: Lee Jones , Pavel Machek , Kees Cook , Wentao Liang , linux-leds@vger.kernel.org, Linux Next Mailing List , Linux Kernel Mailing List Subject: [PATCH linux-next] leds: netxbig: drop the second allocation of the leds array Date: Tue, 1 Dec 2026 10:56:41 -0500 Message-ID: <20261201155641.717600-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 X-Mailing-List: linux-leds@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 Since next-20261120 the merge of the leds-lj tree with the origin tree allocates the leds array in netxbig_leds_get_of_pdata() twice: leds = devm_kzalloc_objs(dev, *leds, num_leds); leds = devm_kcalloc(dev, num_leds, sizeof(*leds), GFP_KERNEL); if (!leds) return -ENOMEM; The first line is the origin side, from commit 4dd10fbbeb9c ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family"). The second is the leds-lj side: commit 41ea2c75f886 ("leds: netxbig: Fix platform device reference leak on successful probe") only changed the error path below it. The first array is never used and stays allocated until the device is unbound. Keep the devm_kzalloc_objs() call and drop the devm_kcalloc() one, as the merge does for the other allocations in this function. Fixes: 7fa58f4b0c86 ("Merge branch 'for-leds-next' of https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git") Link: https://lore.kernel.org/all/c05653b5-c8bd-46ca-aaf5-281e8d74f1e6@sirena.org.uk/ Signed-off-by: Sasha Levin --- For folding into the leds-lj merge. Applies to next-20261130, built drivers/leds/leds-netxbig.o on x86_64 allmodconfig (clang 21, W=1). drivers/leds/leds-netxbig.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c index 29ddebebfa37d..284f3bfad9cbe 100644 --- a/drivers/leds/leds-netxbig.c +++ b/drivers/leds/leds-netxbig.c @@ -510,7 +510,6 @@ static int netxbig_leds_get_of_pdata(struct device *dev, } leds = devm_kzalloc_objs(dev, *leds, num_leds); - leds = devm_kcalloc(dev, num_leds, sizeof(*leds), GFP_KERNEL); if (!leds) return -ENOMEM; base-commit: 253f86660c1f882fbf554db5eaa34bc5d66dc7e8 -- 2.53.0