fix an off-by-one error
authorFelix Fietkau <nbd@openwrt.org>
Sun, 19 Aug 2007 01:06:26 +0000 (01:06 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 19 Aug 2007 01:06:26 +0000 (01:06 +0000)
SVN-Revision: 8427

target/linux/generic-2.6/patches-2.6.22/065-block2mtd_init.patch
target/linux/generic-2.6/patches/065-block2mtd_init.patch

index c653c6a3f32f3943cbee0757bbf87739c479e2da..bae70d41b6945aa88efabeabee02e7d01ac4e8dc 100644 (file)
@@ -32,7 +32,7 @@ diff -urN linux-2.6.21.1.old/drivers/mtd/devices/block2mtd.c linux-2.6.21.1.dev/
 +      if (!mtdname)
 +              mtdname = devname;
 +
-+      dev->mtd.name = kmalloc(strlen(mtdname), GFP_KERNEL);
++      dev->mtd.name = kmalloc(strlen(mtdname) + 1, GFP_KERNEL);
 +
        if (!dev->mtd.name)
                goto devinit_err;
index 57a8615a02f63c7efa70a8e6817f6523b52d7f96..bdb19eeccba9e18fee7f629d4744f5b1ec61cbee 100644 (file)
@@ -32,7 +32,7 @@ diff -urN linux-2.6.21.1.old/drivers/mtd/devices/block2mtd.c linux-2.6.21.1.dev/
 +      if (!mtdname)
 +              mtdname = devname;
 +
-+      dev->mtd.name = kmalloc(strlen(mtdname), GFP_KERNEL);
++      dev->mtd.name = kmalloc(strlen(mtdname) + 1, GFP_KERNEL);
 +
        if (!dev->mtd.name)
                goto devinit_err;