[PATCH] check kmalloc return value in mtd/sm_rtl.c

Artem Bityutskiy dedekind1 at gmail.com
Thu Mar 10 08:21:38 EST 2011


Hi,

On Thu, 2011-03-10 at 13:42 +0800, Xiaochen Wang wrote: 
> @@ -83,12 +87,24 @@ struct attribute_group *sm_create_sysfs_attributes(struct sm_ftl *ftl)
>  	/* Create array of pointers to the attributes */
>  	attributes = kzalloc(sizeof(struct attribute *) * (NUM_ATTRIBUTES + 1),
>  								GFP_KERNEL);
> +	if (!attributes)
> +		got error3;

Please, compile-check patches before sending them out :-)


Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list