Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2286071pxb; Thu, 3 Feb 2022 03:30:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzScQNUoN2feqNwumNVDL4gRBVmY21aL2mUfuRa4XRH3NatnY22w0NO3zX8smOd7Q2bGUpz X-Received: by 2002:a65:424d:: with SMTP id d13mr27535055pgq.82.1643887857696; Thu, 03 Feb 2022 03:30:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643887857; cv=none; d=google.com; s=arc-20160816; b=S+kBih1jOh9uchGAUiBNb6WZbgYd90lCSyEhmjiyKWbrZrqecxPg2H3PqqDssR7lSa e4Hrp7/aEiTFUDCNZ9FTM8mqVN37qHxHZQsGcIsQHWSY0O58fQO+YGk66AzsK1wULbUa 2y1XqbYLb5u4z6lXBeUp9HS77RuKEn4/aLw9rG/A/rl4VZYHLnJUEV7bbnoOHwGcTWu/ kyjBGxkhCZRoR3bG0S+Vwoc6NMPhcK5Diz/hW6KJYygFoLixNojfHDBVsR/ZaD8GxZOG sEdv3AD/c3ugTXL/9i4m2Q7T57Y3iqD20DYOKYvnmBaZg1LcTpnKZTOkA7ezufgIoFxF v70A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=QfWsHpzMv7MOEjkEvoCjQ/ClTe4kUM35UqplmdMDux8=; b=u1Uhvi4t+FCQQO+pKQV3gJuwIoQTjR+1V13nt3a6wPxqcw2503Y5yXU/IspLnZktc7 906H1wuCIt5X4uMlsUi06hroSGP/Ro/y2eqigyXl7ZlL0vVxFS8z1l0D/4l2J57TQePP 3FiSJpjgsLXIH/55Oosg+30ypu3dw/6G/nqVVnKac5OlJ0YDf6aV91baeGbnP0HNxKMG dOfVS0jQIKvo8L9QxfguqjQXMuJy78U1LRFainB+1TJfVT9gDG3+bAqIiq9YhxdMDhhY +F2aMhB8ooSre3+g7uchd93wib0MMHfUP7OBq3D4pS+ENL4tloPEInYkoWFG/I9MQVEt ghtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OBMo4dGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a9si22216476pgj.262.2022.02.03.03.30.38; Thu, 03 Feb 2022 03:30:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OBMo4dGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240340AbiBCG17 (ORCPT + 99 others); Thu, 3 Feb 2022 01:27:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231539AbiBCG16 (ORCPT ); Thu, 3 Feb 2022 01:27:58 -0500 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 410F4C061714 for ; Wed, 2 Feb 2022 22:27:58 -0800 (PST) Received: by mail-yb1-xb2d.google.com with SMTP id c19so5911992ybf.2 for ; Wed, 02 Feb 2022 22:27:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=QfWsHpzMv7MOEjkEvoCjQ/ClTe4kUM35UqplmdMDux8=; b=OBMo4dGol6rni5b6HIbWk5iep7kV8XHSEWwdEisb/CFGwbISqKM9cOqNH80tEw/we8 GM0IjMMesVSzsbWAERweOtuYWPsr5Z/25MRCvUfd8+aiBBBgtiZWqZpaEFfEFJA53a4L 61McLr8vButdB0dVzPyoJQvV/LhcNCgcohB18QsiWo4a22iuN2xmPh+BgOYEwK4zv+5n PfI5fshWL59Oxws2+cZppbruB+vcVoulopkaQACbU8w9mzqd0nVQUPx6r9wOHILfgXaH pLEnTdEDbRFR9L8Tt19QfypIikRGUIAGnCEfT+FpNMCle1hKIZUqZ0Y7/veEj1zTeqWe MrIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=QfWsHpzMv7MOEjkEvoCjQ/ClTe4kUM35UqplmdMDux8=; b=fNtFSOcbGfYknZ8ujixJr6bzlXA0fZPwdb7AAr4G2dg+ZK2DzM0c6x01GJhwm+m+3K ksKjeWlDYL5jvWSGVlhScD/ehQIccx+pj3QdG3l8lnZdU1iEpOpcARtlxefwQOlJwWL2 EVbKte8/utTzZWcIXYhetnw1Ku1DZS4/rtx3alM/4h3TkkMJq4jyJJDcrMH+dHdfIq82 jp9YSw24Y082z/v7fPx1wAQB+9uNxaFIdVtsdBKibt5CqraZPo0UUlOALufzdGWdV44b Hvj2syENjR6evIltc7H9CD7rVs7DfL5UO2YfaDIgWirzi+l4hOoS7cx9W8ouVssbFdI6 /mfQ== X-Gm-Message-State: AOAM532GCsvByQA0hUQiuh+cx1sMqIsrdVElhQGkI1953jbbLou4mww0 CU7iVjcFvIOSd9a8lyYfF9b55jMkpyHUczfMj88= X-Received: by 2002:a25:b003:: with SMTP id q3mr41741638ybf.767.1643869677470; Wed, 02 Feb 2022 22:27:57 -0800 (PST) MIME-Version: 1.0 From: Lukas Bulwahn Date: Thu, 3 Feb 2022 07:27:47 +0100 Message-ID: Subject: Weird code with change "mm/gup: clean up follow_pfn_pte() slightly" To: Andrew Morton , John Hubbard , Linux Kernel Mailing List , Linux-MM Cc: Jason Gunthorpe , Peter Xu , Alex Williamson , Andrea Arcangeli , David Hildenbrand , Jan Kara , Jason Gunthorpe , "Kirill A. Shutemov" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear John, Your change "mm/gup: clean up follow_pfn_pte() slightly" (see Link), visible in linux-next as commit 05fef840b5c6 ("mm/gup: clean up follow_pfn_pte() slightly"), is somehow weird. In the new branch if (pages), you set page = ERR_PTR(-EFAULT) and goto out. However, at the label out, the value of page is not used, but the return uses the variables i and ret. Static analysis tools, such as clang-analyzer, rightfully complain about such weird code. Maybe you can have another look at what you intended to set in the branch of that commit or if you intend to jump to the label out? Best regards, Lukas Link: https://lkml.kernel.org/r/20220201101108.306062-3-jhubbard@nvidia.com