aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/upd.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-05-06 09:12:54 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-07-18 09:53:08 -0400
commit92ad8f37509a7d9d5dd6e0092211b092a7ca7fb1 (patch)
tree96c0f9c524b80e8d1d247e3f462c0c0d6fb782a5 /drivers/mtd/ubi/upd.c
parent79b510c0f21174f4bd055d1aab156e548ae3a5f2 (diff)
UBI: use vmalloc for large buffers
UBI allocates temporary buffers of PEB size, which may be 256KiB. Use vmalloc instead of kmalloc for such big temporary buffers. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/upd.c')
-rw-r--r--drivers/mtd/ubi/upd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c
index 8925b977e3d..0efc586a832 100644
--- a/drivers/mtd/ubi/upd.c
+++ b/drivers/mtd/ubi/upd.c
@@ -150,7 +150,7 @@ int ubi_start_update(struct ubi_device *ubi, int vol_id, long long bytes)
150 vol->updating = 0; 150 vol->updating = 0;
151 } 151 }
152 152
153 vol->upd_buf = kmalloc(ubi->leb_size, GFP_KERNEL); 153 vol->upd_buf = vmalloc(ubi->leb_size);
154 if (!vol->upd_buf) 154 if (!vol->upd_buf)
155 return -ENOMEM; 155 return -ENOMEM;
156 156
@@ -339,7 +339,7 @@ int ubi_more_update_data(struct ubi_device *ubi, int vol_id,
339 err = ubi_wl_flush(ubi); 339 err = ubi_wl_flush(ubi);
340 if (err == 0) { 340 if (err == 0) {
341 err = to_write; 341 err = to_write;
342 kfree(vol->upd_buf); 342 vfree(vol->upd_buf);
343 vol->updating = 0; 343 vol->updating = 0;
344 } 344 }
345 } 345 }