[MTD] Fix length comparison in MEMREADOOB
[sfrench/cifs-2.6.git] / drivers / mtd / afs.c
index 6a45be04564b7cd6b92b4b7afab76696d50feb23..52d51eb91c16f7c1a7a5ec7c3cbbcd5936cb5a39 100644 (file)
@@ -207,11 +207,10 @@ static int parse_afs_partitions(struct mtd_info *mtd,
        if (!sz)
                return ret;
 
-       parts = kmalloc(sz, GFP_KERNEL);
+       parts = kzalloc(sz, GFP_KERNEL);
        if (!parts)
                return -ENOMEM;
 
-       memset(parts, 0, sz);
        str = (char *)(parts + idx);
 
        /*