diff options
author | Zheng Yongjun <zhengyongjun3@huawei.com> | 2021-06-01 16:13:58 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-02 02:01:33 +0200 |
commit | b923cda9638860d6fbb688cfc4c939ff13df31b5 (patch) | |
tree | e5f4d54e688ab2ebea1100ea355c17c1df5a3496 /net/dcb/dcbnl.c | |
parent | igb: Fix -Wunused-const-variable warning (diff) | |
download | linux-b923cda9638860d6fbb688cfc4c939ff13df31b5.tar.xz linux-b923cda9638860d6fbb688cfc4c939ff13df31b5.zip |
net: dcb: Return the correct errno code
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dcb/dcbnl.c')
-rw-r--r-- | net/dcb/dcbnl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 51f80a2f8194..b441ab330fd3 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -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); if (!skb) - return -ENOBUFS; + return -ENOMEM; if (dcbx_ver == DCB_CAP_DCBX_VER_IEEE) err = dcbnl_ieee_fill(skb, dev); @@ -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, nlh->nlmsg_flags, &reply_nlh); if (!reply_skb) - return -ENOBUFS; + return -ENOMEM; ret = fn->cb(netdev, nlh, nlh->nlmsg_seq, tb, reply_skb); if (ret < 0) { |