From: Ruan Jinjie Date: Fri, 18 Aug 2023 05:05:03 +0000 (+0800) Subject: net: microchip: vcap api: Always return ERR_PTR for vcap_get_rule() X-Git-Tag: v6.6.17~4098^2~72^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=093db9cda7b695f963cd7b468ed1488063548ce2;p=platform%2Fkernel%2Flinux-rpi.git net: microchip: vcap api: Always return ERR_PTR 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(), which would be more cleaner in this case. 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/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c index a7b43f9..300fe1a 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c @@ -2429,7 +2429,7 @@ struct vcap_rule *vcap_get_rule(struct vcap_control *vctrl, u32 id) elem = vcap_get_locked_rule(vctrl, id); if (!elem) - return NULL; + return ERR_PTR(-ENOENT); rule = vcap_decode_rule(elem); mutex_unlock(&elem->admin->lock);