From patchwork Thu Apr 28 09:33:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8967391 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0B3A9BF29F for ; Thu, 28 Apr 2016 09:35:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4AA2220268 for ; Thu, 28 Apr 2016 09:35:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6DB0820109 for ; Thu, 28 Apr 2016 09:35:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4AD56E191; Thu, 28 Apr 2016 09:35:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id BAFE66EC9E for ; Thu, 28 Apr 2016 09:35:06 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0LnjYN-1bcjHD46Ax-00hsNZ; Thu, 28 Apr 2016 11:34:57 +0200 From: Arnd Bergmann To: Alex Deucher , Michal Hocko Subject: [PATCH] drm/amdgpu: use ERR_PTR() to return from amdgpu_mn_get Date: Thu, 28 Apr 2016 11:33:48 +0200 Message-Id: <1461836093-1436847-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:6+MKe+RgbgodxIoJbWXxwV3GpLLmWZ5ACmq34IqwTFAyJVI2h5+ +u7pmvIi+ZNWvDobAGEF5U1wrkTCASqQx4dVFZoFDd+CKz5PKiovUKfQVxErkk7iLykIKRl p7GLR1J3hbfgM4Mak27oBms4XDNg9GlW8C2Cun9c4m4PwGvpEciiOM2JfeP9GR81c+GQV6E 6gMbJjuhfWb1Px99zqxeg== X-UI-Out-Filterresults: notjunk:1; V01:K0:V1PoqmC/rQM=:EtFdLOe2SWyPBMD7+142He DumX85c1b1rXq8ZEav4aUt1v79cqW5uwrhRw8oW8LH9g6hIBf6rUZfkcN5RjHVAqKFP9zMSH5 Kk5EM3TaTijovv0KHhSxQ33Ra1JGx1bw+mrBncQTaDu4k4jbqr57URAGAI+DRB7LWGyB/KM0U JkyHwPmyt6TpSNoFK6Kna7AeZrwjPs705oXSiQy/NxlU9iDcS8ZCCnGw3UdJMGuOUfQ+DY8ys lVfRw4YTHzCIvNcQMr0Q/hFy4ff/gb+4qldj0mhql5BayBN7BRZET5/FG/oGCLiB+RtfpfztE NMuKet8rjPSOGR8pwv906NBvwnurN+7jzAd6ZJz6RGHLV86FNbsJd8yadZiPfBUxcHYIno4Oe 3/xReRMsoTcB9XHlDz76s7840y3aRDUaFqzgMAMclzKJNdz1mBh8EnunM3EWtsaYjFz6MX9rV 8SvcLrfjlZSnTIz/LCeMT2+kqXhpWZx4aAXnOeH95IIsLsEiDwjWm5TctkzHHF+rjgxwaDRS4 AQLUVoWrUF0k4XkSt/VjqsOFtjcV83k8rxOhLg9bsXLayJVQ66KnXWFr1iNKIJ9X9ez/t/Otq pB6nqbW8GdO4TTe2NPhPlsxIl05ph06PCOt/bP/7g8RY6Vi6aAcD8T/CMI8tZ9OjYQDDa9Yq9 DgQ5E9XQu9udhr23RFLAUPmdC8zyJdtkWkdSDe/lpCjFwpbutkIHdzOwWnSaiXUSFeBo= Cc: Jack Xiao , Arnd Bergmann , Jammy Zhou , Felix Kuehling , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Monk Liu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The newly added failure path in amdgpu_mn_get() use the wrong return type: drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c: In function 'amdgpu_mn_get': drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:237:10: error: return makes pointer from integer without a cast This adds the necessary ERR_PTR() conversion. Signed-off-by: Arnd Bergmann Fixes: ad35eee9fb17 ("drm/amdgpu: make amdgpu_mn_get wait for mmap_sem killable") Acked-by: Michal Hocko --- drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c index cf90686a50d1..32fa7b7913f7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c @@ -234,7 +234,7 @@ static struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev) mutex_lock(&adev->mn_lock); if (down_write_killable(&mm->mmap_sem)) { mutex_unlock(&adev->mn_lock); - return -EINTR; + return ERR_PTR(-EINTR); } hash_for_each_possible(adev->mn_hash, rmn, node, (unsigned long)mm)