diff options
-rw-r--r-- | drivers/mtd/devices/pmc551.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index 4d4023601d22..62a918895df4 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c | |||
@@ -732,23 +732,20 @@ static int __init init_pmc551(void) | |||
732 | msize = length; | 732 | msize = length; |
733 | } | 733 | } |
734 | 734 | ||
735 | mtd = kmalloc(sizeof(struct mtd_info), GFP_KERNEL); | 735 | mtd = kzalloc(sizeof(struct mtd_info), GFP_KERNEL); |
736 | if (!mtd) { | 736 | if (!mtd) { |
737 | printk(KERN_NOTICE "pmc551: Cannot allocate new MTD " | 737 | printk(KERN_NOTICE "pmc551: Cannot allocate new MTD " |
738 | "device.\n"); | 738 | "device.\n"); |
739 | break; | 739 | break; |
740 | } | 740 | } |
741 | 741 | ||
742 | memset(mtd, 0, sizeof(struct mtd_info)); | 742 | priv = kzalloc(sizeof(struct mypriv), GFP_KERNEL); |
743 | |||
744 | priv = kmalloc(sizeof(struct mypriv), GFP_KERNEL); | ||
745 | if (!priv) { | 743 | if (!priv) { |
746 | printk(KERN_NOTICE "pmc551: Cannot allocate new MTD " | 744 | printk(KERN_NOTICE "pmc551: Cannot allocate new MTD " |
747 | "device.\n"); | 745 | "device.\n"); |
748 | kfree(mtd); | 746 | kfree(mtd); |
749 | break; | 747 | break; |
750 | } | 748 | } |
751 | memset(priv, 0, sizeof(*priv)); | ||
752 | mtd->priv = priv; | 749 | mtd->priv = priv; |
753 | priv->dev = PCI_Device; | 750 | priv->dev = PCI_Device; |
754 | 751 | ||