Skip to content

Commit

Permalink
vxlan: fix error return code in vxlan_fdb_append
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hongbin Wang authored and David S. Miller committed Apr 8, 2022
1 parent 1b80899 commit 7cea556
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/vxlan/vxlan_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7cea556

Please sign in to comment.