Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -155,7 +155,7 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
			     nr_pages, write, 0, pages, NULL);
			     nr_pages, write, 0, pages, NULL);
	up_read(&current->mm->mmap_sem);
	up_read(&current->mm->mmap_sem);


	if (0 <= ret && (unsigned) ret < nr_pages) {
	if (ret >= 0 && ret < nr_pages) {
		while (ret--)
		while (ret--)
			put_page(pages[ret]);
			put_page(pages[ret]);
		ret = -EFAULT;
		ret = -EFAULT;