Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
[sfrench/cifs-2.6.git] / drivers / mtd / ubi / misc.c
index 38d4e6757dc791590e061ae4191333b47203ef8e..93e05281201292c4641d95593eb03158797d29a9 100644 (file)
@@ -67,7 +67,7 @@ int ubi_check_volume(struct ubi_device *ubi, int vol_id)
        if (vol->vol_type != UBI_STATIC_VOLUME)
                return 0;
 
-       buf = kmalloc(vol->usable_leb_size, GFP_KERNEL);
+       buf = vmalloc(vol->usable_leb_size);
        if (!buf)
                return -ENOMEM;
 
@@ -79,7 +79,7 @@ int ubi_check_volume(struct ubi_device *ubi, int vol_id)
                else
                        size = vol->usable_leb_size;
 
-               err = ubi_eba_read_leb(ubi, vol_id, i, buf, 0, size, 1);
+               err = ubi_eba_read_leb(ubi, vol, i, buf, 0, size, 1);
                if (err) {
                        if (err == -EBADMSG)
                                err = 1;
@@ -87,7 +87,7 @@ int ubi_check_volume(struct ubi_device *ubi, int vol_id)
                }
        }
 
-       kfree(buf);
+       vfree(buf);
        return err;
 }