Commit 50f198ae16ac66508d4b8d5a40967a8507ad19ee

Authored by Tyler Hicks
1 parent 57db4e8d73

eCryptfs: Unlock page in write_begin error path

Unlock the page in error path of ecryptfs_write_begin(). This may
happen, for example, if decryption fails while bring the page
up-to-date.

Cc: <stable@kernel.org>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

... ... @@ -381,6 +381,11 @@
381 381 && (pos != 0))
382 382 zero_user(page, 0, PAGE_CACHE_SIZE);
383 383 out:
  384 + if (unlikely(rc)) {
  385 + unlock_page(page);
  386 + page_cache_release(page);
  387 + *pagep = NULL;
  388 + }
384 389 return rc;
385 390 }
386 391