[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200913145520.GH6583@casper.infradead.org>
Date: Sun, 13 Sep 2020 15:55:20 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Souptick Joarder <jrdr.linux@...il.com>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, John Hubbard <jhubbard@...dia.com>
Subject: Re: [PATCH] mm/gup.c: Handling ERR within unpin_user_pages()
On Sun, Sep 13, 2020 at 08:02:35PM +0530, Souptick Joarder wrote:
> It is possible that a buggy caller of unpin_user_pages()
> (specially in error handling path) may end up calling it with
> npages < 0 which is unnecessary.
> @@ -328,6 +328,9 @@ void unpin_user_pages(struct page **pages, unsigned long npages)
> {
> unsigned long index;
>
> + if (WARN_ON_ONCE(npages < 0))
> + return;
But npages is unsigned long. So it can't be less than zero.
Powered by blists - more mailing lists