Netdev List
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: Triet Hoang <triet.hoang.dev@gmail.com>
Cc: netdev@vger.kernel.org, donald.hunter@gmail.com, kuba@kernel.org,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	horms@kernel.org
Subject: Re: [PATCH] tools: ynl: handle calloc failure in ynl_ntf_parse
Date: Wed, 19 Aug 2026 16:11:31 +0800	[thread overview]
Message-ID: <aoVlM1Zr1xsb2TkY@fedora> (raw)
In-Reply-To: <20260818132739.469624-1-triet.hoang.dev@gmail.com>

Hi Triet,

I think your target tree is net-next, but it's close now. You can repost
the patch with the net-next tag after it's reopened.

https://netdev.bots.linux.dev/net-next.html

Thanks
Hangbin
On Tue, Aug 18, 2026 at 01:27:39PM +0000, Triet Hoang wrote:
> Check the return value of calloc() before dereferencing the allocated
> response structure in ynl_ntf_parse().
> 
> Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
> ---
>  tools/net/ynl/lib/ynl.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/net/ynl/lib/ynl.c b/tools/net/ynl/lib/ynl.c
> index 2bcd781111d7..af101544c31a 100644
> --- a/tools/net/ynl/lib/ynl.c
> +++ b/tools/net/ynl/lib/ynl.c
> @@ -889,6 +889,9 @@ static int ynl_ntf_parse(struct ynl_sock *ys, const struct nlmsghdr *nlh)
>  		return YNL_PARSE_CB_ERROR;
>  
>  	rsp = calloc(1, info->alloc_sz);
> +	if (!rsp)
> +		return YNL_PARSE_CB_ERROR;
> +
>  	rsp->free = info->free;
>  	yarg.data = rsp->data;
>  	yarg.rsp_policy = info->policy;
> -- 
> 2.53.0
> 

      reply	other threads:[~2026-08-19  8:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 13:27 [PATCH] tools: ynl: handle calloc failure in ynl_ntf_parse Triet Hoang
2026-08-19  8:11 ` Hangbin Liu [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=aoVlM1Zr1xsb2TkY@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=triet.hoang.dev@gmail.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