Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp234214ybz; Wed, 15 Apr 2020 07:48:07 -0700 (PDT) X-Google-Smtp-Source: APiQypLn7pGVD2tISPt/IxX8dfSDWWYQjgvwQNuA1FPzifoDD6Fcb3DNI6uQ457kXOKxwQytJhfU X-Received: by 2002:a17:906:855a:: with SMTP id h26mr5604997ejy.56.1586962087508; Wed, 15 Apr 2020 07:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586962087; cv=none; d=google.com; s=arc-20160816; b=Qa/0vuEV+/yb+5RJ60wnWA+FfgE1wm5Lq3f/YFhxfOy3wn0JkePZy9S8A96GXoz+Ga Gw3lTULe8nH50Z3ZF4yok6cCmNKOb3J00wUqkvrcAKi8qvSLQkgQ8nnviXcEsV8z0Lba Udc8MuL3u5WNiLdiaYphjz6hZdoP350GKb7+MEghEYsRB/bPu3YGkCPB8QaBDmFQ3OpT CwjqaOA1bQOr/uwig4PTXwW3irFgxauPAiLyEz+qAqD5452tjY4EqVv23rPV36DRzNGl 51Z8Iw5SMtvcUNtCXUT6m9S1TyuMTT0UgTW0fNfvmQbwt2nci/CEmywx5de7ZC0TmJRv HO+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=bIUc1LatWTPrRy0d0hIMzrPytsvlDok1S2YutEMtvpY=; b=Qrv6JwV/AL9quh0wq7Lhrp/uYSQa2+3x96h09Rti+9dKB9/Cz7lEWYKJVww8LePOvT YZJjL6HsYGjzM4oRgtZrq1WHyrth3bRtMMFSoksN2KDkJ6VIYKrDSSowXBUQ/waGNdDo rHWii3KA6C43gWYAjjbbtAoWP0WSI6kkAUs8wlgM0D4m17IS715U7QFDaCGWyozakSBK 43w7oEX/er6hKyOiJ1KLVGurvhM3EFtyXx54NQUE8hdmVXqbWkleFsP4WLjSlIOVeEUL Kbp2d3nvWzD69q0nAxF4LPEY8Oz6ZL5CiXJbi1IA0LzbjHd7ZtEr3r0dd6rmnKy5Rr4y /zmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=pGa7f6AE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ox5si11105253ejb.530.2020.04.15.07.47.43; Wed, 15 Apr 2020 07:48:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=pGa7f6AE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392769AbgDOBxi (ORCPT + 99 others); Tue, 14 Apr 2020 21:53:38 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:28129 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2387766AbgDOBxe (ORCPT ); Tue, 14 Apr 2020 21:53:34 -0400 X-UUID: 73b05dc708bd4681a1b45d44c43761df-20200415 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=bIUc1LatWTPrRy0d0hIMzrPytsvlDok1S2YutEMtvpY=; b=pGa7f6AEhu0gFbZjS5Z0LX1aSJhT3HT0Cja7zjbk0vTDLL//95+yFUEg8ffasW8J+1Ry83bWL3fX2eN4jba/jmWE6FIKKKHZjB5B3p0dLakeRiTvKzZbKE0Mk7kOj5LwhshWnKUYnrWhbs2NsOtddI8dFHlnrMHpTMqyKJkOTR8=; X-UUID: 73b05dc708bd4681a1b45d44c43761df-20200415 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1100836088; Wed, 15 Apr 2020 09:53:27 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 15 Apr 2020 09:53:26 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 15 Apr 2020 09:53:25 +0800 Message-ID: <1586915606.5647.5.camel@mtkswgap22> Subject: Re: [PATCH] mm/gup: fix null pointer dereference detected by coverity From: Miles Chen To: Andrew Morton CC: , , , , Peter Xu Date: Wed, 15 Apr 2020 09:53:26 +0800 In-Reply-To: <20200414170827.d32fc1fc12a33b140b740b94@linux-foundation.org> References: <20200407095107.1988-1-miles.chen@mediatek.com> <20200414170827.d32fc1fc12a33b140b740b94@linux-foundation.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gVHVlLCAyMDIwLTA0LTE0IGF0IDE3OjA4IC0wNzAwLCBBbmRyZXcgTW9ydG9uIHdyb3RlOg0K PiBPbiBUdWUsIDcgQXByIDIwMjAgMTc6NTE6MDcgKzA4MDAgTWlsZXMgQ2hlbiA8bWlsZXMuY2h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