]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Apr 2022 11:53:53 +0000 (13:53 +0200)
[ Upstream commit 7cea5560bf656b84f9ed01c0cc829d4eecd0640b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/vxlan.c

index 48fbdce6a70e7667040935a6567b7be8ac92e83e..72d670667f64f5f2c734752bfb545f5b081d2cc2 100644 (file)
@@ -710,11 +710,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;