drivers/mtd: Use kzalloc
[deliverable/linux.git] / drivers / mtd / maps / ixp4xx.c
index 7b0515297411fc092a3793222f95dd11c9adb6a8..e0a5e0426ead49be256a455df91026427c950e97 100644 (file)
@@ -107,8 +107,8 @@ static void ixp4xx_copy_from(struct map_info *map, void *to,
                return;
 
        if (from & 1) {
-               *dest++ = BYTE1(flash_read16(src));
-                src++;
+               *dest++ = BYTE1(flash_read16(src-1));
+               src++;
                --len;
        }
 
@@ -196,12 +196,11 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
                        return err;
        }
 
-       info = kmalloc(sizeof(struct ixp4xx_flash_info), GFP_KERNEL);
+       info = kzalloc(sizeof(struct ixp4xx_flash_info), GFP_KERNEL);
        if(!info) {
                err = -ENOMEM;
                goto Error;
        }
-       memset(info, 0, sizeof(struct ixp4xx_flash_info));
 
        platform_set_drvdata(dev, info);
 
This page took 0.023687 seconds and 5 git commands to generate.