Commit 7acd4a79 authored by Andy Grover's avatar Andy Grover Committed by David S. Miller

RDS: Fix ordering in a conditional

Putting the constant first is a supposed "best practice" that actually makes
the code harder to read.

Thanks to Roland Dreier for finding a bug in this "simple, obviously correct"
patch.
Signed-off-by: default avatarAndy Grover <andy.grover@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7b70d033
......@@ -155,7 +155,7 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
nr_pages, write, 0, pages, NULL);
up_read(&current->mm->mmap_sem);
if (0 <= ret && (unsigned) ret < nr_pages) {
if (ret >= 0 && ret < nr_pages) {
while (ret--)
put_page(pages[ret]);
ret = -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment