Message ID | 20200528145114.420100-1-colin.king@canonical.com |
---|---|
State | New |
Headers | show |
Series | [net-next] nexthop: fix incorrect allocation failure on nhg->spare | expand |
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index ebafa5ed91ac..97423d6f2de9 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -1185,7 +1185,7 @@ static struct nexthop *nexthop_create_group(struct net *net, /* spare group used for removals */ nhg->spare = nexthop_grp_alloc(num_nh); - if (!nhg) { + if (!nhg->spare) { kfree(nhg); kfree(nh); return NULL;