From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3835CC433EF for ; Fri, 3 Sep 2021 16:35:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CA7FB60F12 for ; Fri, 3 Sep 2021 16:35:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CA7FB60F12 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3B90E940007; Fri, 3 Sep 2021 12:35:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3690C900002; Fri, 3 Sep 2021 12:35:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22FAE940007; Fri, 3 Sep 2021 12:35:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0215.hostedemail.com [216.40.44.215]) by kanga.kvack.org (Postfix) with ESMTP id 1308E900002 for ; Fri, 3 Sep 2021 12:35:46 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id BD5A2184EA6FA for ; Fri, 3 Sep 2021 16:35:45 +0000 (UTC) X-FDA: 78546813450.01.33D107A Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by imf04.hostedemail.com (Postfix) with ESMTP id 6F36350000A4 for ; Fri, 3 Sep 2021 16:35:45 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id h16so9988166lfk.10 for ; Fri, 03 Sep 2021 09:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UrHzbO+aPJ2gt0TfLKDy/KoLK032o09R2ykCU8Cyn+8=; b=EusBIAnsGzxbAt5PyjtTSOJht0vfaNAWkkTaEOXc9uzPaNkRaJ4P5EHe7l1wf1A4nx cJl5Vsvy1k9EyMkvfG385z3kRQ/6GIk7e1TYwSHm8uRp6ftV/AXpy6rB/yhwItbHu0zk UEIvI+ErgnIGOQDmFh39Xfd6Vd9jLP00VjHbg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UrHzbO+aPJ2gt0TfLKDy/KoLK032o09R2ykCU8Cyn+8=; b=nWlQP33MmUxu83oVRpZ/atAfrcdSdcvyXLkzY6ezfZv1iuZNMaadGfUzPe2ziU0joi 1lw28VlSzEggclswqihI2BsMKkcaAGVcUK/yT6wmJPsVtZWGvR8dGiUxBOeWDfYO0M0W Kd4RQ5xNeMIvCQUW4dYbISz/9fvGkAQDUDOkjqsngkaGFx7D2JzjXK6CZKkDyOXV0ulc YDl3FO3WV7B1WgB5HuL+dTYU9QyC4KlNUjUChSoSOu0RwZzqaW+0YKgrHgZNuBvLUx3O 7ZL/x2MirFizSf3KwFBsgTflx3dJkt5safI5HeP3oazjQI5ZFbEhJPwFdb7tHJQVADsf kHng== X-Gm-Message-State: AOAM533ZkIlMz0rwXeNdgwYBIxz8JkR2hOBmeZ55JIa44cgXqR2gfg5b 4J2ZOMTBIcRyU3Et7gplx+x+o4KGH1Bn0MyepNQ= X-Google-Smtp-Source: ABdhPJx28j9E6NDempEwVN1r4DTZgxwZqd7vX6mdYH69f3/hKKRJzVN+5RrGi2Gaz5XlaKH8m0N0hg== X-Received: by 2002:ac2:4c45:: with SMTP id o5mr3566732lfk.22.1630686943282; Fri, 03 Sep 2021 09:35:43 -0700 (PDT) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id u13sm555375lfq.254.2021.09.03.09.35.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Sep 2021 09:35:42 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id y34so12831372lfa.8 for ; Fri, 03 Sep 2021 09:35:42 -0700 (PDT) X-Received: by 2002:a05:6512:114c:: with SMTP id m12mr3488103lfg.150.1630686942198; Fri, 03 Sep 2021 09:35:42 -0700 (PDT) MIME-Version: 1.0 References: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> <20210902215342.RcyFEb0qQ%akpm@linux-foundation.org> In-Reply-To: <20210902215342.RcyFEb0qQ%akpm@linux-foundation.org> From: Linus Torvalds Date: Fri, 3 Sep 2021 09:35:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 071/212] mm: gup: fix potential pgmap refcnt leak in __gup_device_huge() To: Andrew Morton Cc: Claudio Imbrenda , Jan Kara , John Hubbard , "Kirill A . Shutemov" , Miaohe Lin , Linux-MM , mm-commits@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=EusBIAns; spf=pass (imf04.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.42 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 6F36350000A4 X-Stat-Signature: 18c8h6af65ief9gqe7s1gew4mtuf3q86 X-HE-Tag: 1630686945-441397 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Sep 2, 2021 at 2:53 PM Andrew Morton wrote: > > + int ret = 1; .. > + ret = 0; > + break; .. > + ret = 0; > + break; .. > + return ret; Hmm. I think "ret" is unnecessary, and this could just have been return addr == end; at the end to check that we did it all. No? Linus