From: Yan Zhen Date: Thu, 29 Aug 2024 09:55:09 +0000 (+0800) Subject: net: openvswitch: Use ERR_CAST() to return X-Git-Tag: v6.12-rc1~232^2~137 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=b26b64493343659cce8bbffa358bf39e4f68bdec;p=linux-block.git net: openvswitch: Use ERR_CAST() to return Using ERR_CAST() is more reasonable and safer, When it is necessary to convert the type of an error pointer and return it. Signed-off-by: Yan Zhen Acked-by: Eelco Chaudron Reviewed-by: Aaron Conole Link: https://patch.msgid.link/20240829095509.3151987-1-yanzhen@vivo.com Signed-off-by: Jakub Kicinski --- diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index c92bdc4dfe19..729ef582a3a8 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -2491,7 +2491,7 @@ static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, acts = nla_alloc_flow_actions(new_acts_size); if (IS_ERR(acts)) - return (void *)acts; + return ERR_CAST(acts); memcpy(acts->actions, (*sfa)->actions, (*sfa)->actions_len); acts->actions_len = (*sfa)->actions_len;