Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
[safe/jmp/linux-2.6] / drivers / mtd / tests / mtd_speedtest.c
index 7fbb51d..161feeb 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/moduleparam.h>
 #include <linux/err.h>
 #include <linux/mtd/mtd.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 
 #define PRINT_PREF KERN_INFO "mtd_speedtest: "
@@ -294,12 +295,11 @@ static int scan_for_bad_eraseblocks(void)
 {
        int i, bad = 0;
 
-       bbt = kmalloc(ebcnt, GFP_KERNEL);
+       bbt = kzalloc(ebcnt, GFP_KERNEL);
        if (!bbt) {
                printk(PRINT_PREF "error: cannot allocate memory\n");
                return -ENOMEM;
        }
-       memset(bbt, 0 , ebcnt);
 
        /* NOR flash does not implement block_isbad */
        if (mtd->block_isbad == NULL)