vxlan: fix error return code in vxlan_fdb_append

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>
This commit is contained in:
Hongbin Wang 2022-04-06 22:46:22 -04:00 committed by David S. Miller
parent 1b808993e1
commit 7cea5560bf
1 changed files with 2 additions and 2 deletions

View 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;