Message ID | 1325173626-6739-1-git-send-email-dedekind1@gmail.com |
---|---|
State | New, archived |
Headers | show |
Le Thu, 29 Dec 2011 17:47:05 +0200,
Artem Bityutskiy <dedekind1@gmail.com> a écrit :
> + mtd = kzmalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL);
I guess you mean kzalloc() and not kzmalloc().
Thomas
On Thu, 2011-12-29 at 22:31 +0100, Thomas Petazzoni wrote: > Le Thu, 29 Dec 2011 17:47:05 +0200, > Artem Bityutskiy <dedekind1@gmail.com> a écrit : > > > + mtd = kzmalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL); > > I guess you mean kzalloc() and not kzmalloc(). Yes, I have actually had fixed that but then sent the bogus patcy version, thanks! Artem.
diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c index 45116bb..31b84aa 100644 --- a/drivers/mtd/devices/docprobe.c +++ b/drivers/mtd/devices/docprobe.c @@ -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 = kzmalloc(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;