[MTD] Fix length comparison in MEMREADOOB
[sfrench/cifs-2.6.git] / drivers / mtd / afs.c
index 7363e101eb0f0958a8294831047ed191e18c0b93..52d51eb91c16f7c1a7a5ec7c3cbbcd5936cb5a39 100644 (file)
@@ -1,27 +1,27 @@
 /*======================================================================
 
     drivers/mtd/afs.c: ARM Flash Layout/Partitioning
-  
+
     Copyright (C) 2000 ARM Limited
-  
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-  
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-  
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-  
-   This is access code for flashes using ARM's flash partitioning 
+
+   This is access code for flashes using ARM's flash partitioning
    standards.
 
-   $Id: afs.c,v 1.13 2004/02/27 22:09:59 rmk Exp $
+   $Id: afs.c,v 1.15 2005/11/07 11:14:19 gleixner Exp $
 
 ======================================================================*/
 
@@ -163,7 +163,7 @@ afs_read_iis(struct mtd_info *mtd, struct image_info_struct *iis, u_int ptr)
        return ret;
 }
 
-static int parse_afs_partitions(struct mtd_info *mtd, 
+static int parse_afs_partitions(struct mtd_info *mtd,
                          struct mtd_partition **pparts,
                          unsigned long origin)
 {
@@ -207,11 +207,10 @@ static int parse_afs_partitions(struct mtd_info *mtd,
        if (!sz)
                return ret;
 
-       parts = kmalloc(sz, GFP_KERNEL);
+       parts = kzalloc(sz, GFP_KERNEL);
        if (!parts)
                return -ENOMEM;
 
-       memset(parts, 0, sz);
        str = (char *)(parts + idx);
 
        /*