Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / drivers / mtd / ubi / io.c
index 515d4fd..67f46f8 100644 (file)
@@ -932,6 +932,11 @@ static int validate_vid_hdr(const struct ubi_device *ubi,
                goto bad;
        }
 
+       if (data_size > ubi->leb_size) {
+               ubi_err("bad data_size");
+               goto bad;
+       }
+
        if (vol_type == UBI_VID_STATIC) {
                /*
                 * Although from high-level point of view static volumes may