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
[ Upstream commit 7cea556 ]

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>
  • Loading branch information
wang0666 authored and gregkh committed Apr 27, 2022
1 parent 61a1681 commit d247169
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,11 +712,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 d247169

Please sign in to comment.