Commit
b8d3c4c3009d ("mm/huge_memory.c: don't split THP page when
MADV_FREE syscall is called") introduced this new function, but got the
error handling for when pmd_trans_huge_lock() fails wrong. In the
failure case, the lock has not been taken, and we should not unlock on
the way out.
Cc: Minchan Kim <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
int ret = 0;
if (!pmd_trans_huge_lock(pmd, vma, &ptl))
- goto out;
+ goto out_unlocked;
orig_pmd = *pmd;
if (is_huge_zero_pmd(orig_pmd)) {