--- initial
+++ final
@@ -1,76 +1,75 @@
 static int ixp2000_flash_probe(struct platform_device *dev) {
   static const char *probes[] = {"RedBoot", "cmdlinepart", NULL};
   struct ixp2000_flash_data *ixp_data = dev->dev.platform_data;
   struct flash_platform_data *plat;
   struct ixp2000_flash_info *info;
   unsigned long window_size;
   int err = -1;
   if (!ixp_data) return -ENODEV;
   plat = ixp_data->platform_data;
   if (!plat) return -ENODEV;
   window_size = dev->resource->end - dev->resource->start + 1;
   dev_info(&dev->dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", ixp_data->nr_banks, ((u32)window_size >> 20));
   if (plat->width != 1) {
     dev_err(&dev->dev, "IXP2000 MTD map only supports 8-bit mode, asking for %d\n", plat->width * 8);
     return -EIO;
   }
-  info = kmalloc(sizeof(struct ixp2000_flash_info), GFP_KERNEL);
+  info = kzalloc(sizeof(struct ixp2000_flash_info), GFP_KERNEL);
   if (!info) {
     err = -ENOMEM;
     goto Error;
   }
-  memset(info, 0, sizeof(struct ixp2000_flash_info));
   platform_set_drvdata(dev, info);
   /*
    * Tell the MTD layer we're not 1:1 mapped so that it does
    * not attempt to do a direct access on us.
    */
   info->map.phys = NO_XIP;
   info->map.size = ixp_data->nr_banks * window_size;
   info->map.bankwidth = 1;
   /*
    * map_priv_2 is used to store a ptr to the bank_setup routine
    */
   info->map.map_priv_2 = (unsigned long)ixp_data->bank_setup;
   info->map.name = dev_name(&dev->dev);
   info->map.read = ixp2000_flash_read8;
   info->map.write = ixp2000_flash_write8;
   info->map.copy_from = ixp2000_flash_copy_from;
   info->map.copy_to = ixp2000_flash_copy_to;
   info->res = request_mem_region(dev->resource->start, dev->resource->end - dev->resource->start + 1, dev_name(&dev->dev));
   if (!info->res) {
     dev_err(&dev->dev, "Could not reserve memory region\n");
     err = -ENOMEM;
     goto Error;
   }
   info->map.map_priv_1 = (unsigned long)ioremap(dev->resource->start, dev->resource->end - dev->resource->start + 1);
   if (!info->map.map_priv_1) {
     dev_err(&dev->dev, "Failed to ioremap flash region\n");
     err = -EIO;
     goto Error;
   }
 #if defined(__ARMEB__)
   /*
    * Enable erratum 44 workaround for NPUs with broken slowport
    */
   erratum44_workaround = ixp2000_has_broken_slowport();
   dev_info(&dev->dev, "Erratum 44 workaround %s\n", erratum44_workaround ? "enabled" : "disabled");
 #endif
   info->mtd = do_map_probe(plat->map_name, &info->map);
   if (!info->mtd) {
     dev_err(&dev->dev, "map_probe failed\n");
     err = -ENXIO;
     goto Error;
   }
   info->mtd->owner = THIS_MODULE;
   err = parse_mtd_partitions(info->mtd, probes, &info->partitions, 0);
   if (err > 0) {
     err = add_mtd_partitions(info->mtd, info->partitions, err);
     if (err) dev_err(&dev->dev, "Could not parse partitions\n");
   }
   if (err) goto Error;
   return 0;
 Error:
   ixp2000_flash_remove(dev);
   return err;
 }<sep>@@
expression e1,e2,e3;
identifier print1,print2;
constant char[] c1;
constant char[] c2;
statement S;
@@

-       e3 = kmalloc(e1, e2)
+       e3 = kzalloc(e1, e2)
        <... when != e3
(
	print1(...,c1,...,e3,...);
|
	kfree(e3);
)
       ...>
        if (e3 == NULL || ...) S
        <... when != e3
(
	print2(...,c2,...,e3,...);
|
	kfree(e3);
)
        ...>
-       memset(e3, 0, e1);