diff options
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r-- | drivers/mtd/ubi/scan.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index b24af2104a2a..cbd588d60168 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
@@ -356,7 +356,7 @@ static int compare_lebs(const struct ubi_device *ubi, | |||
356 | /* Read the data of the copy and check the CRC */ | 356 | /* Read the data of the copy and check the CRC */ |
357 | 357 | ||
358 | len = ubi32_to_cpu(vid_hdr->data_size); | 358 | len = ubi32_to_cpu(vid_hdr->data_size); |
359 | buf = kmalloc(len, GFP_KERNEL); | 359 | buf = vmalloc(len); |
360 | if (!buf) { | 360 | if (!buf) { |
361 | err = -ENOMEM; | 361 | err = -ENOMEM; |
362 | goto out_free_vidh; | 362 | goto out_free_vidh; |
@@ -379,7 +379,7 @@ static int compare_lebs(const struct ubi_device *ubi, | |||
379 | bitflips = !!err; | 379 | bitflips = !!err; |
380 | } | 380 | } |
381 | 381 | ||
382 | kfree(buf); | 382 | vfree(buf); |
383 | ubi_free_vid_hdr(ubi, vidh); | 383 | ubi_free_vid_hdr(ubi, vidh); |
384 | 384 | ||
385 | if (second_is_newer) | 385 | if (second_is_newer) |
@@ -390,7 +390,7 @@ static int compare_lebs(const struct ubi_device *ubi, | |||
390 | return second_is_newer | (bitflips << 1) | (corrupted << 2); | 390 | return second_is_newer | (bitflips << 1) | (corrupted << 2); |
391 | 391 | ||
392 | out_free_buf: | 392 | out_free_buf: |
393 | kfree(buf); | 393 | vfree(buf); |
394 | out_free_vidh: | 394 | out_free_vidh: |
395 | ubi_free_vid_hdr(ubi, vidh); | 395 | ubi_free_vid_hdr(ubi, vidh); |
396 | ubi_assert(err < 0); | 396 | ubi_assert(err < 0); |