Message ID | CAPgLHd8F8-uRfAi4R=xqHa76X8N9P+-UosF-6zC=OXStKbcP-A@mail.gmail.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Wei Yongjun <weiyj.lk@gmail.com> Date: Wed, 27 Mar 2013 21:22:45 +0800 > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn> > > Fix to return a negative error code from the error handling case > instead of 0(possible overwrite to 0 by ops->fill_xstats call), > as returned elsewhere in this function. > > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 5fb8d7e..b65441d 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;