Skip to content

Commit

Permalink
unitialized return value in mm/mlock.c: __mlock_vma_pages_range()
Browse files Browse the repository at this point in the history
Fix an unitialized return value when compiling on parisc (with CONFIG_UNEVICTABLE_LRU=y):
	mm/mlock.c: In function `__mlock_vma_pages_range':
	mm/mlock.c:165: warning: `ret' might be used uninitialized in this function

Signed-off-by: Helge Deller <deller@gmx.de>
[ It isn't ever really used uninitialized, since no caller should ever
  call this function with an empty range.  But the compiler is correct
  that from a local analysis standpoint that is impossible to see, and
  fixing the warning is appropriate.  ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Helge Deller authored and Linus Torvalds committed Nov 16, 2008
1 parent e14c8bf commit 72eb8c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/mlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
unsigned long addr = start;
struct page *pages[16]; /* 16 gives a reasonable batch */
int nr_pages = (end - start) / PAGE_SIZE;
int ret;
int ret = 0;
int gup_flags = 0;

VM_BUG_ON(start & ~PAGE_MASK);
Expand Down

0 comments on commit 72eb8c6

Please sign in to comment.