aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/fib_hash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 76b9c684cccd..8d58d85dfac6 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -372,7 +372,8 @@ static struct fib_node *fib_find_node(struct fn_zone *fz, __be32 key)
372static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) 372static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
373{ 373{
374 struct fn_hash *table = (struct fn_hash *) tb->tb_data; 374 struct fn_hash *table = (struct fn_hash *) tb->tb_data;
375 struct fib_node *new_f, *f; 375 struct fib_node *new_f = NULL;
376 struct fib_node *f;
376 struct fib_alias *fa, *new_fa; 377 struct fib_alias *fa, *new_fa;
377 struct fn_zone *fz; 378 struct fn_zone *fz;
378 struct fib_info *fi; 379 struct fib_info *fi;
@@ -496,7 +497,6 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
496 497
497 err = -ENOBUFS; 498 err = -ENOBUFS;
498 499
499 new_f = NULL;
500 if (!f) { 500 if (!f) {
501 new_f = kmem_cache_zalloc(fn_hash_kmem, GFP_KERNEL); 501 new_f = kmem_cache_zalloc(fn_hash_kmem, GFP_KERNEL);
502 if (new_f == NULL) 502 if (new_f == NULL)
@@ -512,7 +512,7 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
512 if (new_fa->fa_info != NULL) { 512 if (new_fa->fa_info != NULL) {
513 new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL); 513 new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL);
514 if (new_fa == NULL) 514 if (new_fa == NULL)
515 goto out_free_new_f; 515 goto out;
516 } 516 }
517 new_fa->fa_info = fi; 517 new_fa->fa_info = fi;
518 new_fa->fa_tos = tos; 518 new_fa->fa_tos = tos;
@@ -540,9 +540,9 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
540 &cfg->fc_nlinfo, 0); 540 &cfg->fc_nlinfo, 0);
541 return 0; 541 return 0;
542 542
543out_free_new_f:
544 kmem_cache_free(fn_hash_kmem, new_f);
545out: 543out:
544 if (new_f)
545 kmem_cache_free(fn_hash_kmem, new_f);
546 fib_release_info(fi); 546 fib_release_info(fi);
547 return err; 547 return err;
548} 548}