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=1796203507; b=OFtS8OGel2eUHIp4xYZUIpKsICa2TBGPauWvnT5Gx376e8DWQoWM3mz69rVN5r1I7Cv9 JES7xIo+zJabWhZ6g971F5xPhYLU1snG5UbLar7ZYFtpwgAEz2pcZrcoCp3O3B7z+oa0R TPafaMOed8smk314xSFpZj2w+ZQm8PIQbMYojD++U+cQpWAFGFp56iJv+JQLOCmbafibX wHDb6l6BaepDu+FB0Hw4ozF45QURN8JNpAcqV3NWyc08kb8JwAeFaknrGg3dbkYTsqk8n VTvUKEpIrH7N43QCAEk0LQJaGKrvJAAcGKA45LaIo1CdOgV1IvYLgOMqaV1ZDu8KjXQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796203507; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=MA5i9MSxGELf5Abtd3dUUhYlruewsF+PHSzkBnNGghs=; b=l1lcRC8IoVlszd610hVaHmbFkWfuFPRGF8VSXbJ/dbq57mB0C8WTl2u4s4CYq7YW6hWd xs96AjnYpR5etcQR6Jl2ZourWBLhKNVrpJ+HMaXozMLEyQAJSE9HI38vwnHzy644ewRqF qqbNYoUEglUXcPNUF7+BqvoadXg3Wl0vLYnJ+z2R+18CgGGmRjJM58Mg+v8wuE7y+m4WL UokfoRiwLassRJsOZdOrvbjdJ9EMtkboHOmMB1u9CFaTEWikCphBIw8k7XQXpkxLcLTOC BkVCLBHYVV9Ju0KglZXRC5x+m36V3vnjZN1htuX3mCgXHTgDWBv/E0JGg/DoWuiUPkg== 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=FciXr6Vx; 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 8D253606A32A; Wed, 2 Dec 2026 09:25:07 +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=FciXr6Vx Received: by smtp.kernel.org (Postfix) with ESMTPSA id 583FB1F0089C; Wed, 2 Dec 2026 09:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796203507; bh=MA5i9MSxGELf5Abtd3dUUhYlruewsF+PHSzkBnNGghs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=FciXr6Vx3xmEF7L2ba5mf7n7NPa/ij0gnFcqdyo+veaU2rrMA0AsamvzYQTBT+EZ8 X1yiuasB4uZfLphwNBbVrKKmysxgD+JQmcQmUOVT2NbeKRNm2cx3uvn73qUo2nV+zN Ltr73netV34/DL2M28AkKIdI2KERfgdHliBiJBwUohllrfir6cfRYy9TwS50oDjJyb +r1Hti+jsp/qnvN14o+Z5R0enQ/dxQYz4bHHeeMJCR6Mo9IWMKNGQF1lv5ZHhj2JcC o+HXGdyRcebeO7z2FCblAWr+fseknbulRzu0Px4CGs4gwQdaHsVc8bw26+Ai5DuCY+ cGQzn4RxWUmeQ== Date: Wed, 2 Dec 2026 09:25:02 +0000 From: Lee Jones To: Sasha Levin , Mark Brown Cc: Mark Brown , Pavel Machek , Kees Cook , Wentao Liang , linux-leds@vger.kernel.org, Linux Next Mailing List , Linux Kernel Mailing List Subject: Re: [PATCH linux-next] leds: netxbig: drop the second allocation of the leds array Message-ID: <20261202092502.GQ90630@joneslee-mac.roam.internal> References: <20261201155641.717600-1-sashal@kernel.org> 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201155641.717600-1-sashal@kernel.org> FAO Mark, > 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). I think this was Mark's -next patch. > 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 > -- Lee Jones