From: Ruan Jinjie Date: Fri, 18 Aug 2023 05:05:05 +0000 (+0800) Subject: net: microchip: sparx5: Update return value check for vcap_get_rule() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=95b358e4d9c7caad3a787f810265458ee477d0ef;p=linux.git net: microchip: sparx5: Update return value check for vcap_get_rule() As Simon Horman suggests, update vcap_get_rule() to always return an ERR_PTR() and update the error detection conditions to use IS_ERR(), so use IS_ERR() to check the return value. Signed-off-by: Ruan Jinjie Suggested-by: Simon Horman Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c index 906299ad84251..523e0c470894f 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c @@ -1274,7 +1274,7 @@ static int sparx5_tc_free_rule_resources(struct net_device *ndev, int ret = 0; vrule = vcap_get_rule(vctrl, rule_id); - if (!vrule || IS_ERR(vrule)) + if (IS_ERR(vrule)) return -EINVAL; sparx5_tc_free_psfp_resources(sparx5, vrule);