rtnetlink: Add return value check
This patch add return value checking for both of the nla_put_u32() and nla_put_u8() in rtnl_xdp_fill(). Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com> Signed-off-by: Aravindhan Gunasekaran <aravindhan.gunasekaran@intel.com>
This commit is contained in:
parent
74eb52ddc6
commit
31679da96f
|
@ -1531,8 +1531,12 @@ static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev)
|
|||
if (!md_btf_id)
|
||||
goto err_cancel;
|
||||
|
||||
nla_put_u32(skb, IFLA_XDP_MD_BTF_ID, md_btf_id);
|
||||
nla_put_u8(skb, IFLA_XDP_MD_BTF_STATE, md_btf_enabled);
|
||||
err = nla_put_u32(skb, IFLA_XDP_MD_BTF_ID, md_btf_id);
|
||||
if (err)
|
||||
goto err_cancel;
|
||||
err = nla_put_u8(skb, IFLA_XDP_MD_BTF_STATE, md_btf_enabled);
|
||||
if (err)
|
||||
goto err_cancel;
|
||||
|
||||
nla_nest_end(skb, xdp);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue