vxlan: fix error return code in vxlan_fdb_append
authorHongbin Wang <wh_bin@126.com>
Thu, 7 Apr 2022 02:46:22 +0000 (22:46 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Apr 2022 11:35:12 +0000 (12:35 +0100)
When kmalloc and dst_cache_init failed,
should return ENOMEM rather than ENOBUFS.

Signed-off-by: Hongbin Wang <wh_bin@126.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan/vxlan_core.c

index de97ff9..8a5e3a6 100644 (file)
@@ -651,11 +651,11 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
 
        rd = kmalloc(sizeof(*rd), GFP_ATOMIC);
        if (rd == NULL)
-               return -ENOBUFS;
+               return -ENOMEM;
 
        if (dst_cache_init(&rd->dst_cache, GFP_ATOMIC)) {
                kfree(rd);
-               return -ENOBUFS;
+               return -ENOMEM;
        }
 
        rd->remote_ip = *ip;