summaryrefslogtreecommitdiffstats
path: root/mm/madvise.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2013-09-11 14:23:03 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 15:58:13 -0700
commit325c4ef5c4b17372c3222d896040d7848e67fbdb (patch)
tree7d0d86431400f4d15123ea24ee0610145d1163b2 /mm/madvise.c
parent8302423b8e85ad6caa8687f06157d43f684a42e2 (diff)
downloadop-kernel-dev-325c4ef5c4b17372c3222d896040d7848e67fbdb.zip
op-kernel-dev-325c4ef5c4b17372c3222d896040d7848e67fbdb.tar.gz
mm/madvise.c:madvise_hwpoison(): remove local `ret'
madvise_hwpoison() has two locals called "ret". Fix it all up. Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Andi Kleen <andi@firstfloor.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/madvise.c')
-rw-r--r--mm/madvise.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/madvise.c b/mm/madvise.c
index 51bffa4..6975bc8 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -343,15 +343,16 @@ static long madvise_remove(struct vm_area_struct *vma,
*/
static int madvise_hwpoison(int bhv, unsigned long start, unsigned long end)
{
- int ret = 0;
-
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
for (; start < end; start += PAGE_SIZE) {
struct page *p;
- int ret = get_user_pages_fast(start, 1, 0, &p);
+ int ret;
+
+ ret = get_user_pages_fast(start, 1, 0, &p);
if (ret != 1)
return ret;
+
if (PageHWPoison(p)) {
put_page(p);
continue;
@@ -369,7 +370,7 @@ static int madvise_hwpoison(int bhv, unsigned long start, unsigned long end)
/* Ignore return value for now */
memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED);
}
- return ret;
+ return 0;
}
#endif
OpenPOWER on IntegriCloud