fix an off-by-one error

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8427 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Felix Fietkau 2007-08-19 01:06:26 +00:00
parent 35f806df3d
commit 6c8dca8c44
2 changed files with 2 additions and 2 deletions

View 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) + if (!mtdname)
+ mtdname = devname; + mtdname = devname;
+ +
+ dev->mtd.name = kmalloc(strlen(mtdname), GFP_KERNEL); + dev->mtd.name = kmalloc(strlen(mtdname) + 1, GFP_KERNEL);
+ +
if (!dev->mtd.name) if (!dev->mtd.name)
goto devinit_err; goto devinit_err;

View 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) + if (!mtdname)
+ mtdname = devname; + mtdname = devname;
+ +
+ dev->mtd.name = kmalloc(strlen(mtdname), GFP_KERNEL); + dev->mtd.name = kmalloc(strlen(mtdname) + 1, GFP_KERNEL);
+ +
if (!dev->mtd.name) if (!dev->mtd.name)
goto devinit_err; goto devinit_err;