ipv4: fib_semantics: increment fib_info_cnt after fib_info allocation
authorSergey Popovich <popovich_sergei@mail.ru>
Tue, 6 May 2014 15:23:08 +0000 (18:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 May 2014 20:20:37 +0000 (13:20 -0700)
commit13c5c91b6b4a68dd9ac5b4ea9974c0d1402daa0f
tree531067b1745f9eb4eb1e75840065dc86ad3a2743
parent8eb6ded767268d02e88155b4ced544cebe2ba495
ipv4: fib_semantics: increment fib_info_cnt after fib_info allocation

[ Upstream commit aeefa1ecfc799b0ea2c4979617f14cecd5cccbfd ]

Increment fib_info_cnt in fib_create_info() right after successfuly
alllocating fib_info structure, overwise fib_metrics allocation failure
leads to fib_info_cnt incorrectly decremented in free_fib_info(), called
on error path from fib_create_info().

Signed-off-by: Sergey Popovich <popovich_sergei@mail.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/fib_semantics.c