diff mbox series

[3/5] mm: gup: remove useless BUG_ON in __get_user_pages()

Message ID 20210807093620.21347-4-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series Cleanups and fixup for gup | expand

Commit Message

Miaohe Lin Aug. 7, 2021, 9:36 a.m. UTC
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.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/gup.c | 1 -
 1 file changed, 1 deletion(-)

Comments

David Hildenbrand Aug. 9, 2021, 9:23 a.m. UTC | #1
On 07.08.21 11:36, Miaohe Lin wrote:
> 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.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>   mm/gup.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index d6056dcab02c..d7e4507de6b1 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;
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/gup.c b/mm/gup.c
index d6056dcab02c..d7e4507de6b1 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;