diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 5fb8d7e472941fede3595a3a4032cfc21fbe849b..b65441da74abd85cc8deacc7650c583013e9dcfb 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -496,8 +496,10 @@ static int rtnl_link_fill(struct sk_buff *skb, const struct net_device *dev) } if (ops->fill_info) { data = nla_nest_start(skb, IFLA_INFO_DATA); - if (data == NULL) + if (data == NULL) { + err = -EMSGSIZE; goto err_cancel_link; + } err = ops->fill_info(skb, dev); if (err < 0) goto err_cancel_data;