8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b14208 commit 5e5783eCopy full SHA for 5e5783e
ch9/slab_custom/slab_custom.c
@@ -49,7 +49,7 @@ struct myctx {
49
};
50
static struct kmem_cache *gctx_cachep;
51
52
-static void use_our_cache(void)
+static int use_our_cache(void)
53
{
54
struct myctx *obj = NULL;
55
@@ -62,6 +62,7 @@ static void use_our_cache(void)
62
obj = kmem_cache_alloc(gctx_cachep, GFP_KERNEL);
63
if (!obj) { /* pedantic warning printk below... */
64
pr_warn("kmem_cache_alloc() failed\n");
65
+ return -ENOMEM;
66
}
67
68
pr_info("Our cache object (@ %pK, actual=%px) size is %u bytes; actual ksize=%zu\n",
@@ -70,6 +71,7 @@ static void use_our_cache(void)
70
71
72
/* free it */
73
kmem_cache_free(gctx_cachep, obj);
74
+ return 0;
75
76
77
/* The parameter is the pointer to the just allocated memory 'object' from
0 commit comments