diff options
Diffstat (limited to 'fs/jffs2/malloc.c')
| -rw-r--r-- | fs/jffs2/malloc.c | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/jffs2/malloc.c b/fs/jffs2/malloc.c index c082868910f..b8fd651307a 100644 --- a/fs/jffs2/malloc.c +++ b/fs/jffs2/malloc.c @@ -9,6 +9,8 @@   *   */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +  #include <linux/kernel.h>  #include <linux/slab.h>  #include <linux/init.h> @@ -286,6 +288,8 @@ struct jffs2_xattr_datum *jffs2_alloc_xattr_datum(void)  	struct jffs2_xattr_datum *xd;  	xd = kmem_cache_zalloc(xattr_datum_cache, GFP_KERNEL);  	dbg_memalloc("%p\n", xd); +	if (!xd) +		return NULL;  	xd->class = RAWNODE_CLASS_XATTR_DATUM;  	xd->node = (void *)xd; @@ -304,6 +308,8 @@ struct jffs2_xattr_ref *jffs2_alloc_xattr_ref(void)  	struct jffs2_xattr_ref *ref;  	ref = kmem_cache_zalloc(xattr_ref_cache, GFP_KERNEL);  	dbg_memalloc("%p\n", ref); +	if (!ref) +		return NULL;  	ref->class = RAWNODE_CLASS_XATTR_REF;  	ref->node = (void *)ref;  | 
