diff options
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br.c | 4 | ||||
-rw-r--r-- | net/bridge/br_fdb.c | 6 | ||||
-rw-r--r-- | net/bridge/br_private.h | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/net/bridge/br.c b/net/bridge/br.c index 601c37d61c03..848b8fa8bedd 100644 --- a/net/bridge/br.c +++ b/net/bridge/br.c | |||
@@ -37,7 +37,9 @@ static int __init br_init(void) | |||
37 | return -EADDRINUSE; | 37 | return -EADDRINUSE; |
38 | } | 38 | } |
39 | 39 | ||
40 | br_fdb_init(); | 40 | err = br_fdb_init(); |
41 | if (err) | ||
42 | goto err_out1; | ||
41 | 43 | ||
42 | err = br_netfilter_init(); | 44 | err = br_netfilter_init(); |
43 | if (err) | 45 | if (err) |
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 22645e3edf23..91b017016d5b 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -31,13 +31,17 @@ static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source, | |||
31 | 31 | ||
32 | static u32 fdb_salt __read_mostly; | 32 | static u32 fdb_salt __read_mostly; |
33 | 33 | ||
34 | void __init br_fdb_init(void) | 34 | int __init br_fdb_init(void) |
35 | { | 35 | { |
36 | br_fdb_cache = kmem_cache_create("bridge_fdb_cache", | 36 | br_fdb_cache = kmem_cache_create("bridge_fdb_cache", |
37 | sizeof(struct net_bridge_fdb_entry), | 37 | sizeof(struct net_bridge_fdb_entry), |
38 | 0, | 38 | 0, |
39 | SLAB_HWCACHE_ALIGN, NULL, NULL); | 39 | SLAB_HWCACHE_ALIGN, NULL, NULL); |
40 | if (!br_fdb_cache) | ||
41 | return -ENOMEM; | ||
42 | |||
40 | get_random_bytes(&fdb_salt, sizeof(fdb_salt)); | 43 | get_random_bytes(&fdb_salt, sizeof(fdb_salt)); |
44 | return 0; | ||
41 | } | 45 | } |
42 | 46 | ||
43 | void __exit br_fdb_fini(void) | 47 | void __exit br_fdb_fini(void) |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 974feccd28b1..21bf3a9a03fd 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -141,7 +141,7 @@ extern void br_dev_setup(struct net_device *dev); | |||
141 | extern int br_dev_xmit(struct sk_buff *skb, struct net_device *dev); | 141 | extern int br_dev_xmit(struct sk_buff *skb, struct net_device *dev); |
142 | 142 | ||
143 | /* br_fdb.c */ | 143 | /* br_fdb.c */ |
144 | extern void br_fdb_init(void); | 144 | extern int br_fdb_init(void); |
145 | extern void br_fdb_fini(void); | 145 | extern void br_fdb_fini(void); |
146 | extern void br_fdb_flush(struct net_bridge *br); | 146 | extern void br_fdb_flush(struct net_bridge *br); |
147 | extern void br_fdb_changeaddr(struct net_bridge_port *p, | 147 | extern void br_fdb_changeaddr(struct net_bridge_port *p, |