From 6ed41184fa615596fb1c29e9fe2f7c7d5e8142eb Mon Sep 17 00:00:00 2001 From: Hanjie Lin Date: Thu, 16 May 2019 13:38:20 +0800 Subject: [PATCH] mm: arm: fix unmatched pte_offset_map/pte_unmap error [1/1] PD#TV-5777 Problem: [CVTE][T972][9.0][System]: PT190004-1300: Appear auto reboot exception during downloading Facebook app. get_user_pfn() may caused unmatched pte_offset_map/pte_unmap call, then may cause bad task preempt_count and subsequently panic. Solution: add matched pte_offset_map/pte_unmap Verify: tl1 Change-Id: I98240b443b8a0fae89d0ee93701eb1bfdce51b82 Signed-off-by: Hanjie Lin --- arch/arm/mm/fault.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 6e59e64195cc..a2a06fcebbb7 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -153,8 +153,10 @@ static long get_user_pfn(struct mm_struct *mm, unsigned long addr) break; pte = pte_offset_map(pmd, addr); - if (pte_none(*pte)) + if (pte_none(*pte)) { + pte_unmap(pte); break; + } pfn = pte_pfn(*pte); pte_unmap(pte);