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)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 May 2014 09:49:29 +0000 (11:49 +0200)
commitd4e90595f9f3c66c88af853f2a08a103280126fc
treee2195e94285bbf93f9b96627439c2f9562c88bc6
parent156439bd5ca8f99ad08e12723a5f687719815b33
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: Jiri Slaby <jslaby@suse.cz>
net/ipv4/fib_semantics.c