- /* allocate our sock slab caches */
- tcp6_sk_cachep = kmem_cache_create("tcp6_sock",
- sizeof(struct tcp6_sock), 0,
- SLAB_HWCACHE_ALIGN, 0, 0);
- udp6_sk_cachep = kmem_cache_create("udp6_sock",
- sizeof(struct udp6_sock), 0,
- SLAB_HWCACHE_ALIGN, 0, 0);
- raw6_sk_cachep = kmem_cache_create("raw6_sock",
- sizeof(struct raw6_sock), 0,
- SLAB_HWCACHE_ALIGN, 0, 0);
- if (!tcp6_sk_cachep || !udp6_sk_cachep || !raw6_sk_cachep)
- printk(KERN_CRIT "%s: Can't create protocol sock SLAB "
- "caches!\n", __FUNCTION__);
+
+ err = sk_alloc_slab(&tcpv6_prot, "tcpv6_sock");
+ if (err) {
+ sk_alloc_slab_error(&tcpv6_prot);
+ goto out;
+ }
+ err = sk_alloc_slab(&udpv6_prot, "udpv6_sock");
+ if (err) {
+ sk_alloc_slab_error(&udpv6_prot);
+ goto out_tcp_free_slab;
+ }
+ err = sk_alloc_slab(&rawv6_prot, "rawv6_sock");
+ if (err) {
+ sk_alloc_slab_error(&rawv6_prot);
+ goto out_udp_free_slab;
+ }