]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/devices/docprobe.c
Merge branch 'for-3.7' of git://linux-nfs.org/~bfields/linux
[karo-tx-linux.git] / drivers / mtd / devices / docprobe.c
index 45116bb302972ba5cbde40719778aa4cb065635e..706b847b46b30ae0d34b1ded35b9529495d9fbc2 100644 (file)
@@ -241,8 +241,7 @@ static void __init DoC_Probe(unsigned long physadr)
                        return;
                }
                docfound = 1;
-               mtd = kmalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL);
-
+               mtd = kzalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL);
                if (!mtd) {
                        printk(KERN_WARNING "Cannot allocate memory for data structures. Dropping.\n");
                        iounmap(docptr);
@@ -250,10 +249,6 @@ static void __init DoC_Probe(unsigned long physadr)
                }
 
                this = (struct DiskOnChip *)(&mtd[1]);
-
-               memset((char *)mtd,0, sizeof(struct mtd_info));
-               memset((char *)this, 0, sizeof(struct DiskOnChip));
-
                mtd->priv = this;
                this->virtadr = docptr;
                this->physadr = physadr;