Commit 325c4ef5c4b17372c3222d896040d7848e67fbdb
Committed by
Linus Torvalds
1 parent
8302423b8e
Exists in
master
and in
20 other branches
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>
Showing 1 changed file with 5 additions and 4 deletions Side-by-side Diff
mm/madvise.c
... | ... | @@ -343,15 +343,16 @@ |
343 | 343 | */ |
344 | 344 | static int madvise_hwpoison(int bhv, unsigned long start, unsigned long end) |
345 | 345 | { |
346 | - int ret = 0; | |
347 | - | |
348 | 346 | if (!capable(CAP_SYS_ADMIN)) |
349 | 347 | return -EPERM; |
350 | 348 | for (; start < end; start += PAGE_SIZE) { |
351 | 349 | struct page *p; |
352 | - int ret = get_user_pages_fast(start, 1, 0, &p); | |
350 | + int ret; | |
351 | + | |
352 | + ret = get_user_pages_fast(start, 1, 0, &p); | |
353 | 353 | if (ret != 1) |
354 | 354 | return ret; |
355 | + | |
355 | 356 | if (PageHWPoison(p)) { |
356 | 357 | put_page(p); |
357 | 358 | continue; |
... | ... | @@ -369,7 +370,7 @@ |
369 | 370 | /* Ignore return value for now */ |
370 | 371 | memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED); |
371 | 372 | } |
372 | - return ret; | |
373 | + return 0; | |
373 | 374 | } |
374 | 375 | #endif |
375 | 376 |