]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0052-UBI-fix-nameless-volumes-handling.patch
linux-ti33x-psp 3.2: update to 3.2.21, add libertas fixes
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.2 / 0052-UBI-fix-nameless-volumes-handling.patch
1 From addbb632cd11d02b5386a9ebf040b0f89b6e2c84 Mon Sep 17 00:00:00 2001
2 From: Richard Weinberger <richard@nod.at>
3 Date: Fri, 13 Jan 2012 15:07:40 +0100
4 Subject: [PATCH 052/129] UBI: fix nameless volumes handling
6 commit 4a59c797a18917a5cf3ff7ade296b46134d91e6a upstream.
8 Currently it's possible to create a volume without a name. E.g:
9 ubimkvol -n 32 -s 2MiB -t static /dev/ubi0 -N ""
11 After that vtbl_check() will always fail because it does not permit
12 empty strings.
14 Signed-off-by: Richard Weinberger <richard@nod.at>
15 Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 ---
18  drivers/mtd/ubi/cdev.c |    3 +++
19  1 file changed, 3 insertions(+)
21 diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
22 index 3320a50..ad76592 100644
23 --- a/drivers/mtd/ubi/cdev.c
24 +++ b/drivers/mtd/ubi/cdev.c
25 @@ -632,6 +632,9 @@ static int verify_mkvol_req(const struct ubi_device *ubi,
26         if (req->alignment != 1 && n)
27                 goto bad;
28  
29 +       if (!req->name[0] || !req->name_len)
30 +               goto bad;
31 +
32         if (req->name_len > UBI_VOL_NAME_MAX) {
33                 err = -ENAMETOOLONG;
34                 goto bad;
35 -- 
36 1.7.9.5