Thread (9 messages) 9 messages, 4 authors, 2017-08-11

[PATCH net-next] skbuff: Add BUG_ON in skb_init.

flat view
STALE3365d

From: Tonghao Zhang <hidden>
Date: 2017-08-09 12:05:08
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

When initializing the skbuff SLAB cache, we should make
sure it is successful. Adding BUG_ON to check it and
init_inodecache() is in the same case.

Signed-off-by: Tonghao Zhang <redacted>
---
 net/core/skbuff.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 42b62c716a33..9513de519870 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3904,6 +3904,8 @@ void __init skb_init(void)
 						0,
 						SLAB_HWCACHE_ALIGN|SLAB_PANIC,
 						NULL);
+	BUG_ON(skbuff_head_cache == NULL);
+	BUG_ON(skbuff_fclone_cache == NULL);
 }
 
 static int
-- 
2.13.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help