[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <61a0b15c-8a68-230a-5f5b-3f5025dff24a@suse.cz>
Date: Tue, 31 Oct 2017 09:55:35 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Yisheng Xie <xieyisheng1@...wei.com>, akpm@...ux-foundation.org,
mhocko@...e.com, mingo@...nel.org, rientjes@...gle.com,
n-horiguchi@...jp.nec.com, salls@...ucsb.edu
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
tanxiaojun@...wei.com, linux-api@...r.kernel.org
Subject: Re: [PATCH RFC v2 2/4] mm/mempolicy: remove redundant check in
get_nodes
On 10/27/2017 12:14 PM, Yisheng Xie wrote:
> We have already checked whether maxnode is a page worth of bits, by:
> maxnode > PAGE_SIZE*BITS_PER_BYTE
>
> So no need to check it once more.
>
> Signed-off-by: Yisheng Xie <xieyisheng1@...wei.com>
Acked-by: Vlastimil Babka <vbabka@...e.cz>
> ---
> mm/mempolicy.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 613e9d0..3b51bb3 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -1280,8 +1280,6 @@ static int get_nodes(nodemask_t *nodes, const unsigned long __user *nmask,
> /* When the user specified more nodes than supported just check
> if the non supported part is all zero. */
> if (nlongs > BITS_TO_LONGS(MAX_NUMNODES)) {
> - if (nlongs > PAGE_SIZE/sizeof(long))
> - return -EINVAL;
> for (k = BITS_TO_LONGS(MAX_NUMNODES); k < nlongs; k++) {
> unsigned long t;
> if (get_user(t, nmask + k))
>
Powered by blists - more mailing lists