netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: "Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	"Jeff Garzik" <jeff@garzik.org>,
	"Maciej W. Rozycki" <macro@orcam.me.uk>,
	"Mariusz Kozlowski" <m.kozlowski@tuxland.pl>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] net: ethernet: broadcom: sb1250-mac: Add checks for kcalloc() in sbdma_initctx()
Date: Thu, 18 Sep 2025 07:15:16 -0700	[thread overview]
Message-ID: <20250918071516.4ca7f752@kernel.org> (raw)
In-Reply-To: <20250918121051.3504490-1-lgs201920130244@gmail.com>

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@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.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

      reply	other threads:[~2025-09-18 14:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 12:10 [PATCH] net: ethernet: broadcom: sb1250-mac: Add checks for kcalloc() in sbdma_initctx() Guangshuo Li
2025-09-18 14:15 ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250918071516.4ca7f752@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jeff@garzik.org \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.kozlowski@tuxland.pl \
    --cc=macro@orcam.me.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).