aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/eba.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/eba.c')
-rw-r--r--drivers/mtd/ubi/eba.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index 7c6b223b3f8a..6964fe4ab41a 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -524,7 +524,7 @@ retry:
524 goto write_error; 524 goto write_error;
525 525
526 data_size = offset + len; 526 data_size = offset + len;
527 new_buf = kmalloc(data_size, GFP_KERNEL); 527 new_buf = vmalloc(data_size);
528 if (!new_buf) { 528 if (!new_buf) {
529 err = -ENOMEM; 529 err = -ENOMEM;
530 goto out_put; 530 goto out_put;
@@ -535,7 +535,7 @@ retry:
535 if (offset > 0) { 535 if (offset > 0) {
536 err = ubi_io_read_data(ubi, new_buf, pnum, 0, offset); 536 err = ubi_io_read_data(ubi, new_buf, pnum, 0, offset);
537 if (err && err != UBI_IO_BITFLIPS) { 537 if (err && err != UBI_IO_BITFLIPS) {
538 kfree(new_buf); 538 vfree(new_buf);
539 goto out_put; 539 goto out_put;
540 } 540 }
541 } 541 }
@@ -544,11 +544,11 @@ retry:
544 544
545 err = ubi_io_write_data(ubi, new_buf, new_pnum, 0, data_size); 545 err = ubi_io_write_data(ubi, new_buf, new_pnum, 0, data_size);
546 if (err) { 546 if (err) {
547 kfree(new_buf); 547 vfree(new_buf);
548 goto write_error; 548 goto write_error;
549 } 549 }
550 550
551 kfree(new_buf); 551 vfree(new_buf);
552 ubi_free_vid_hdr(ubi, vid_hdr); 552 ubi_free_vid_hdr(ubi, vid_hdr);
553 553
554 vol->eba_tbl[lnum] = new_pnum; 554 vol->eba_tbl[lnum] = new_pnum;
@@ -977,7 +977,7 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
977 data_size = aldata_size = 977 data_size = aldata_size =
978 ubi->leb_size - ubi32_to_cpu(vid_hdr->data_pad); 978 ubi->leb_size - ubi32_to_cpu(vid_hdr->data_pad);
979 979
980 buf = kmalloc(aldata_size, GFP_KERNEL); 980 buf = vmalloc(aldata_size);
981 if (!buf) 981 if (!buf)
982 return -ENOMEM; 982 return -ENOMEM;
983 983
@@ -987,7 +987,7 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
987 */ 987 */
988 err = leb_write_lock(ubi, vol_id, lnum); 988 err = leb_write_lock(ubi, vol_id, lnum);
989 if (err) { 989 if (err) {
990 kfree(buf); 990 vfree(buf);
991 return err; 991 return err;
992 } 992 }
993 993
@@ -1082,7 +1082,7 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1082 * We've written the data and are going to read it back to make 1082 * We've written the data and are going to read it back to make
1083 * sure it was written correctly. 1083 * sure it was written correctly.
1084 */ 1084 */
1085 buf1 = kmalloc(aldata_size, GFP_KERNEL); 1085 buf1 = vmalloc(aldata_size);
1086 if (!buf1) { 1086 if (!buf1) {
1087 err = -ENOMEM; 1087 err = -ENOMEM;
1088 goto out_unlock; 1088 goto out_unlock;
@@ -1111,15 +1111,15 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1111 vol->eba_tbl[lnum] = to; 1111 vol->eba_tbl[lnum] = to;
1112 1112
1113 leb_write_unlock(ubi, vol_id, lnum); 1113 leb_write_unlock(ubi, vol_id, lnum);
1114 kfree(buf); 1114 vfree(buf);
1115 kfree(buf1); 1115 vfree(buf1);
1116 1116
1117 return 0; 1117 return 0;
1118 1118
1119out_unlock: 1119out_unlock:
1120 leb_write_unlock(ubi, vol_id, lnum); 1120 leb_write_unlock(ubi, vol_id, lnum);
1121 kfree(buf); 1121 vfree(buf);
1122 kfree(buf1); 1122 vfree(buf1);
1123 return err; 1123 return err;
1124} 1124}
1125 1125