From: Simon Horman <horms@kernel•org>
To: Ruan Jinjie <ruanjinjie@huawei•com>
Cc: netdev@vger•kernel.org, linux@armlinux•org.uk,
Horatiu Vultur <horatiu.vultur@microchip•com>,
UNGLinuxDriver@microchip•com,
"David S. Miller" <davem@davemloft•net>,
Eric Dumazet <edumazet@google•com>,
Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
Richard Cochran <richardcochran@gmail•com>
Subject: Re: [PATCH net-next] net: lan966x: Fix return value check for vcap_get_rule()
Date: Thu, 17 Aug 2023 20:34:58 +0200 [thread overview]
Message-ID: <ZN5oUpbbRWie9676@vergenet.net> (raw)
In-Reply-To: <20230817123726.1885512-1-ruanjinjie@huawei.com>
On Thu, Aug 17, 2023 at 08:37:26PM +0800, Ruan Jinjie wrote:
> Since vcap_get_rule() return NULL or ERR_PTR(), just check NULL
> is not correct. So use IS_ERR_OR_NULL() to fix the issue.
>
> Fixes: 72df3489fb10 ("net: lan966x: Add ptp trap rules")
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei•com>
> ---
> drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Hi Ruan Jinjie,
Could we consider updating vcap_get_rule() to always return an ERR_PTR()
and update the error detection conditions to use IS_ERR()?
It seems to me that would be somewhat cleaner in this case.
next prev parent reply other threads:[~2023-08-17 18:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 12:37 [PATCH net-next] net: lan966x: Fix return value check for vcap_get_rule() Ruan Jinjie
2023-08-17 18:34 ` Simon Horman [this message]
2023-08-18 1:25 ` Ruan Jinjie
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=ZN5oUpbbRWie9676@vergenet.net \
--to=horms@kernel$(echo .)org \
--cc=UNGLinuxDriver@microchip$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=horatiu.vultur@microchip$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=richardcochran@gmail$(echo .)com \
--cc=ruanjinjie@huawei$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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