[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250918071516.4ca7f752@kernel.org>
Date: Thu, 18 Sep 2025 07:15:16 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Guangshuo Li <lgs201920130244@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, Uwe Kleine-König
<u.kleine-koenig@...libre.com>, Jeff Garzik <jeff@...zik.org>, "Maciej W.
Rozycki" <macro@...am.me.uk>, Mariusz Kozlowski <m.kozlowski@...land.pl>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] net: ethernet: broadcom: sb1250-mac: Add checks for
kcalloc() in sbdma_initctx()
On Thu, 18 Sep 2025 20:10:51 +0800 Guangshuo Li wrote:
> Fixes: 73d739698017 ("sb1250-mac.c: De-typedef, de-volatile, de-etc...")
> Fixes: c477f3348abb ("drivers/net/sb1250-mac.c: kmalloc + memset conversion to kcalloc")
neither of these tags is correct, the bug existed before them
The Fixes tag should point to the commit that added the bug,
not the last commit that touched the line
> Cc: stable@...r.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@...il.com>
> ---
> drivers/net/ethernet/broadcom/sb1250-mac.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/sb1250-mac.c b/drivers/net/ethernet/broadcom/sb1250-mac.c
> index 30865fe03eeb..e16a49e22488 100644
> --- a/drivers/net/ethernet/broadcom/sb1250-mac.c
> +++ b/drivers/net/ethernet/broadcom/sb1250-mac.c
> @@ -625,6 +625,8 @@ static void sbdma_initctx(struct sbmacdma *d, struct sbmac_softc *s, int chan,
> d->sbdma_dscrtable_unaligned = kcalloc(d->sbdma_maxdescr + 1,
> sizeof(*d->sbdma_dscrtable),
> GFP_KERNEL);
> + if (!d->sbdma_dscrtable_unaligned)
> + return; /* avoid NULL deref in ALIGN/phys conversion */
This comment is completely unnecessary
Please make sure to read:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html
before proceeding
--
pw-bot: cr
Powered by blists - more mailing lists