diff options
author | Zheng Yongjun <zhengyongjun3@huawei.com> | 2021-06-01 17:14:07 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-02 03:02:15 +0300 |
commit | ca746c55a7e6e597cc2d29a094082d345b2c33c9 (patch) | |
tree | 8f1ad7915ad4efc304b5602597d61bb0f856744d /net | |
parent | b923cda9638860d6fbb688cfc4c939ff13df31b5 (diff) | |
download | linux-ca746c55a7e6e597cc2d29a094082d345b2c33c9.tar.xz |
net: 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')
-rw-r--r-- | net/ipv4/af_inet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index d9bccad65e2b..750f388a4a68 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -318,7 +318,7 @@ lookup_protocol: WARN_ON(!answer_prot->slab); - err = -ENOBUFS; + err = -ENOMEM; sk = sk_alloc(net, PF_INET, GFP_KERNEL, answer_prot, kern); if (!sk) goto out; |