mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mm/vmscan.c: fix mapping use after free
We need lock_page_nosync() here because we have no reference to the mapping when taking the page lock. Signed-off-by: Nick Piggin <[email protected]> Reviewed-by: Johannes Weiner <[email protected]> Cc: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c61284e991
commit
a6aa62a090
1 changed files with 1 additions and 1 deletions
|
|
@ -298,7 +298,7 @@ static int may_write_to_queue(struct backing_dev_info *bdi)
|
|||
static void handle_write_error(struct address_space *mapping,
|
||||
struct page *page, int error)
|
||||
{
|
||||
lock_page(page);
|
||||
lock_page_nosync(page);
|
||||
if (page_mapping(page) == mapping)
|
||||
mapping_set_error(mapping, error);
|
||||
unlock_page(page);
|
||||
|
|
|
|||
Loading…
Reference in a new issue