lkml.org 
[lkml]   [2014]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] arch: metag: mm: hugetlbpage.c: Cleaning up inconsistent NULL checks
Date
Cleaning up inconsistent NULL checks.
There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
arch/metag/mm/hugetlbpage.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/metag/mm/hugetlbpage.c b/arch/metag/mm/hugetlbpage.c
index 0424315..3f8d5cd 100644
--- a/arch/metag/mm/hugetlbpage.c
+++ b/arch/metag/mm/hugetlbpage.c
@@ -188,7 +188,8 @@ new_search:
}
}
after_huge = 0;
- addr = ALIGN_HUGEPT(vma->vm_end);
+ if (vma)
+ addr = ALIGN_HUGEPT(vma->vm_end);
}
}
#endif
--
1.7.10.4


\
 
 \ /
  Last update: 2014-05-23 02:21    [W:0.116 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site