aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r--fs/ecryptfs/crypto.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index e890d596da7e..1ae90ef2c74d 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -605,14 +605,14 @@ int ecryptfs_decrypt_page(struct page *page)
605 printk(KERN_ERR "%s: Error attempting to copy " 605 printk(KERN_ERR "%s: Error attempting to copy "
606 "page at index [%ld]\n", __FUNCTION__, 606 "page at index [%ld]\n", __FUNCTION__,
607 page->index); 607 page->index);
608 goto out_clear_uptodate; 608 goto out;
609 } 609 }
610 enc_extent_virt = kmalloc(PAGE_CACHE_SIZE, GFP_USER); 610 enc_extent_virt = kmalloc(PAGE_CACHE_SIZE, GFP_USER);
611 if (!enc_extent_virt) { 611 if (!enc_extent_virt) {
612 rc = -ENOMEM; 612 rc = -ENOMEM;
613 ecryptfs_printk(KERN_ERR, "Error allocating memory for " 613 ecryptfs_printk(KERN_ERR, "Error allocating memory for "
614 "encrypted extent\n"); 614 "encrypted extent\n");
615 goto out_clear_uptodate; 615 goto out;
616 } 616 }
617 enc_extent_page = virt_to_page(enc_extent_virt); 617 enc_extent_page = virt_to_page(enc_extent_virt);
618 for (extent_offset = 0; 618 for (extent_offset = 0;
@@ -631,21 +631,17 @@ int ecryptfs_decrypt_page(struct page *page)
631 ecryptfs_printk(KERN_ERR, "Error attempting " 631 ecryptfs_printk(KERN_ERR, "Error attempting "
632 "to read lower page; rc = [%d]" 632 "to read lower page; rc = [%d]"
633 "\n", rc); 633 "\n", rc);
634 goto out_clear_uptodate; 634 goto out;
635 } 635 }
636 rc = ecryptfs_decrypt_extent(page, crypt_stat, enc_extent_page, 636 rc = ecryptfs_decrypt_extent(page, crypt_stat, enc_extent_page,
637 extent_offset); 637 extent_offset);
638 if (rc) { 638 if (rc) {
639 printk(KERN_ERR "%s: Error encrypting extent; " 639 printk(KERN_ERR "%s: Error encrypting extent; "
640 "rc = [%d]\n", __FUNCTION__, rc); 640 "rc = [%d]\n", __FUNCTION__, rc);
641 goto out_clear_uptodate; 641 goto out;
642 } 642 }
643 extent_offset++; 643 extent_offset++;
644 } 644 }
645 SetPageUptodate(page);
646 goto out;
647out_clear_uptodate:
648 ClearPageUptodate(page);
649out: 645out:
650 kfree(enc_extent_virt); 646 kfree(enc_extent_virt);
651 return rc; 647 return rc;