Subject: Re: [PATCH net-next] net: lan966x: Fix return value check for vcap_get_rule()

From: Simon Horman <[email-masked]>
Date: Thu, 17 Aug 2023 20:34:58 +0200

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 <[email-masked]>
> ---
>  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.