X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/1ebe6d34880d1e26b37fe4f794b5039a8245e750..adde7768a2eab2950a7628319ec832c63a00ff03:/target/linux/generic-2.6/patches/065-block2mtd_init.patch?ds=sidebyside diff --git a/target/linux/generic-2.6/patches/065-block2mtd_init.patch b/target/linux/generic-2.6/patches/065-block2mtd_init.patch index ef483bedd..0e36f9ad0 100644 --- a/target/linux/generic-2.6/patches/065-block2mtd_init.patch +++ b/target/linux/generic-2.6/patches/065-block2mtd_init.patch @@ -1,5 +1,7 @@ ---- linux.old/drivers/mtd/devices/block2mtd.c 2007-03-02 01:00:13.866987272 +0100 -+++ linux.dev/drivers/mtd/devices/block2mtd.c 2007-03-02 02:03:45.558522080 +0100 +Index: linux-2.6.21.7/drivers/mtd/devices/block2mtd.c +=================================================================== +--- linux-2.6.21.7.orig/drivers/mtd/devices/block2mtd.c ++++ linux-2.6.21.7/drivers/mtd/devices/block2mtd.c @@ -16,6 +16,7 @@ #include #include @@ -8,7 +10,7 @@ #include #include #include -@@ -287,10 +288,11 @@ +@@ -288,10 +289,11 @@ static void block2mtd_free_device(struct /* FIXME: ensure that mtd->size % erase_size == 0 */ @@ -21,7 +23,7 @@ if (!devname) return NULL; -@@ -330,14 +332,18 @@ +@@ -330,14 +332,18 @@ static struct block2mtd_dev *add_device( /* Setup the MTD structure */ /* make the name contain the block device in */ @@ -31,7 +33,7 @@ + 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; @@ -45,7 +47,7 @@ dev->mtd.erasesize = erase_size; dev->mtd.writesize = 1; dev->mtd.type = MTD_RAM; -@@ -349,15 +355,18 @@ +@@ -349,15 +355,18 @@ static struct block2mtd_dev *add_device( dev->mtd.read = block2mtd_read; dev->mtd.priv = dev; dev->mtd.owner = THIS_MODULE; @@ -68,7 +70,7 @@ return dev; devinit_err: -@@ -430,9 +439,9 @@ +@@ -430,9 +439,9 @@ static __initdata char block2mtd_paramli static int block2mtd_setup2(const char *val) { @@ -80,7 +82,7 @@ char *name; size_t erase_size = PAGE_SIZE; int i, ret; -@@ -443,7 +452,7 @@ +@@ -443,7 +452,7 @@ static int block2mtd_setup2(const char * strcpy(str, val); kill_final_newline(str); @@ -89,7 +91,7 @@ token[i] = strsep(&str, ","); if (str) -@@ -463,8 +472,10 @@ +@@ -463,8 +472,10 @@ static int block2mtd_setup2(const char * parse_err("illegal erase size"); } } @@ -101,7 +103,7 @@ return 0; } -@@ -498,7 +509,7 @@ +@@ -498,7 +509,7 @@ static int block2mtd_setup(const char *v module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);