Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d63bddbe authored by Daniel Lezcano's avatar Daniel Lezcano Committed by David S. Miller
Browse files

[IPV6]: Make fib6_init to return an error code.



If there is an error in the initialization function, nothing is
followed up to the caller. So I add a return value to be set for the
init function.

Signed-off-by: default avatarDaniel Lezcano <dlezcano@fr.ibm.com>
Acked-by: default avatarBenjamin Thery <benjamin.thery@bull.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5a3e55d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -224,7 +224,7 @@ extern void fib6_run_gc(unsigned long dummy);


extern void			fib6_gc_cleanup(void);
extern void			fib6_gc_cleanup(void);


extern void			fib6_init(void);
extern int			fib6_init(void);


extern void			fib6_rules_init(void);
extern void			fib6_rules_init(void);
extern void			fib6_rules_cleanup(void);
extern void			fib6_rules_cleanup(void);
+11 −3
Original line number Original line Diff line number Diff line
@@ -1473,16 +1473,24 @@ void fib6_run_gc(unsigned long dummy)
	spin_unlock_bh(&fib6_gc_lock);
	spin_unlock_bh(&fib6_gc_lock);
}
}


void __init fib6_init(void)
int __init fib6_init(void)
{
{
	int ret;
	fib6_node_kmem = kmem_cache_create("fib6_nodes",
	fib6_node_kmem = kmem_cache_create("fib6_nodes",
					   sizeof(struct fib6_node),
					   sizeof(struct fib6_node),
					   0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
					   0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
					   NULL);
					   NULL);

	fib6_tables_init();
	fib6_tables_init();


	__rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib);
	ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib);
	if (ret)
		goto out_kmem_cache_create;
out:
	return ret;

out_kmem_cache_create:
	kmem_cache_destroy(fib6_node_kmem);
	goto out;
}
}


void fib6_gc_cleanup(void)
void fib6_gc_cleanup(void)