Commit b923cda9 authored by Zheng Yongjun's avatar Zheng Yongjun Committed by David S. Miller

net: dcb: Return the correct errno code

When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a206f9d
...@@ -1381,7 +1381,7 @@ static int dcbnl_notify(struct net_device *dev, int event, int cmd, ...@@ -1381,7 +1381,7 @@ static int dcbnl_notify(struct net_device *dev, int event, int cmd,
skb = dcbnl_newmsg(event, cmd, portid, seq, 0, &nlh); skb = dcbnl_newmsg(event, cmd, portid, seq, 0, &nlh);
if (!skb) if (!skb)
return -ENOBUFS; return -ENOMEM;
if (dcbx_ver == DCB_CAP_DCBX_VER_IEEE) if (dcbx_ver == DCB_CAP_DCBX_VER_IEEE)
err = dcbnl_ieee_fill(skb, dev); err = dcbnl_ieee_fill(skb, dev);
...@@ -1781,7 +1781,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, ...@@ -1781,7 +1781,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
reply_skb = dcbnl_newmsg(fn->type, dcb->cmd, portid, nlh->nlmsg_seq, reply_skb = dcbnl_newmsg(fn->type, dcb->cmd, portid, nlh->nlmsg_seq,
nlh->nlmsg_flags, &reply_nlh); nlh->nlmsg_flags, &reply_nlh);
if (!reply_skb) if (!reply_skb)
return -ENOBUFS; return -ENOMEM;
ret = fn->cb(netdev, nlh, nlh->nlmsg_seq, tb, reply_skb); ret = fn->cb(netdev, nlh, nlh->nlmsg_seq, tb, reply_skb);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment