netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Leon Romanovsky <leon@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, saeedm@nvidia.com
Subject: Re: [PATCH net-next] eth: mlx5: avoid iterator use outside of a loop
Date: Mon, 17 Apr 2023 12:44:50 -0700	[thread overview]
Message-ID: <20230417124450.6a06686e@kernel.org> (raw)
In-Reply-To: <20230416101753.GB15386@unreal>

On Sun, 16 Apr 2023 13:17:53 +0300 Leon Romanovsky wrote:
> > -	return mlx5_irq_get_affinity_mask(eq->core.irq);
> > +	WARN_ON_ONCE(1);
> > +	return 0;  
> 
> I would do it without changing last return, but "return ERR_PTR(0);"
> will do the trick too.

Hm, I've not seen ERR_PTR(0) used before. I'll return NULL. 
Looks like callers pass the value to cpumask_first() without checking 
so either way the warning will be followed by a crash 🤷️

  reply	other threads:[~2023-04-17 19:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 18:07 [PATCH net-next] eth: mlx5: avoid iterator use outside of a loop Jakub Kicinski
2023-04-15  4:20 ` kernel test robot
2023-04-16 10:17 ` Leon Romanovsky
2023-04-17 19:44   ` Jakub Kicinski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-04-20  1:58 Jakub Kicinski
2023-04-20  4:03 ` Saeed Mahameed
2023-04-21  2:50 ` patchwork-bot+netdevbpf

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=20230417124450.6a06686e@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.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).