Blob Blame History Raw
From 6bdea55934eedeb049e9778d88b3803358ce8af2 Mon Sep 17 00:00:00 2001
From: Miaohe Lin <linmiaohe@huawei.com>
Date: Thu, 2 Sep 2021 14:53:39 -0700
Subject: [PATCH] mm: gup: remove useless BUG_ON in __get_user_pages()

References: git fixes (mm)
Patch-mainline: v5.15-rc1
Git-commit: 06a9e696639c5e0f457ae117c39ec4cbe5096dc9

Indeed, this BUG_ON couldn't catch anything useful.  We are sure ret == 0
here because we would already bail out if ret != 0 and ret is untouched
till here.

Link: https://lkml.kernel.org/r/20210807093620.21347-4-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Mel Gorman <mgorman@suse.de>
---
 mm/gup.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/gup.c b/mm/gup.c
index 82074e819a8d..9f5b9a93ae21 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1149,7 +1149,6 @@ static long __get_user_pages(struct mm_struct *mm,
 					 * We must stop here.
 					 */
 					BUG_ON(gup_flags & FOLL_NOWAIT);
-					BUG_ON(ret != 0);
 					goto out;
 				}
 				continue;