UBI: fix nameless volumes handling
[pandora-kernel.git] / drivers / mtd / ubi / cdev.c
index 3320a50..ad76592 100644 (file)
@@ -632,6 +632,9 @@ static int verify_mkvol_req(const struct ubi_device *ubi,
        if (req->alignment != 1 && n)
                goto bad;
 
+       if (!req->name[0] || !req->name_len)
+               goto bad;
+
        if (req->name_len > UBI_VOL_NAME_MAX) {
                err = -ENAMETOOLONG;
                goto bad;