File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ struct myctx {
49
49
};
50
50
static struct kmem_cache * gctx_cachep ;
51
51
52
- static void use_our_cache (void )
52
+ static int use_our_cache (void )
53
53
{
54
54
struct myctx * obj = NULL ;
55
55
@@ -62,6 +62,7 @@ static void use_our_cache(void)
62
62
obj = kmem_cache_alloc (gctx_cachep , GFP_KERNEL );
63
63
if (!obj ) { /* pedantic warning printk below... */
64
64
pr_warn ("kmem_cache_alloc() failed\n" );
65
+ return - ENOMEM ;
65
66
}
66
67
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
71
72
/* free it */
72
73
kmem_cache_free (gctx_cachep , obj );
74
+ return 0 ;
73
75
}
74
76
75
77
/* The parameter is the pointer to the just allocated memory 'object' from
You can’t perform that action at this time.
0 commit comments