linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Kunwu Chan <chentao@kylinos.cn>
Cc: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kunwu Chan <kunwu.chan@hotmail.com>
Subject: Re: [PATCH] net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe
Date: Tue, 12 Dec 2023 13:27:55 -0800	[thread overview]
Message-ID: <20231212132755.261ee49d@kernel.org> (raw)
In-Reply-To: <20231211024549.231417-1-chentao@kylinos.cn>

On Mon, 11 Dec 2023 10:45:49 +0800 Kunwu Chan wrote:
>  	vsc->gc.label = devm_kasprintf(vsc->dev, GFP_KERNEL, "VSC%04x",
>  				       vsc->chipid);
> +	if (!vsc->gc.label) {
> +		dev_err(vsc->dev, "Fail to allocate memory\n");
> +		return -ENOMEM;
> +	}

Don't add error prints on memory allocations.
There will be an OOM splat in the logs.
-- 
pw-bot: cr

  reply	other threads:[~2023-12-12 21:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11  2:45 [PATCH] net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe Kunwu Chan
2023-12-12 21:27 ` Jakub Kicinski [this message]
2023-12-14  3:22   ` Kunwu Chan

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=20231212132755.261ee49d@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=chentao@kylinos.cn \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kunwu.chan@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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).