]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - drivers/mtd/ubi/cdev.c
UBI: fix nameless volumes handling
[~shefty/rdma-dev.git] / drivers / mtd / ubi / cdev.c
index 3320a50ba4f0c81f75e48154bd4202f50ead4fad..ad76592fb2f485479570097cb616757c6c4d905b 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;