From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753848AbcD1KGv (ORCPT ); Thu, 28 Apr 2016 06:06:51 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35747 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753839AbcD1KGr (ORCPT ); Thu, 28 Apr 2016 06:06:47 -0400 Date: Thu, 28 Apr 2016 12:06:44 +0200 From: Michal Hocko To: Arnd Bergmann , Andrew Morton Cc: Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Felix Kuehling , Jammy Zhou , Monk Liu , Jack Xiao , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/amdgpu: use ERR_PTR() to return from amdgpu_mn_get Message-ID: <20160428100644.GC31489@dhcp22.suse.cz> References: <1461836093-1436847-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461836093-1436847-1-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 28-04-16 11:33:48, Arnd Bergmann wrote: > 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") This is in the mmotm tree so the sha is unstable. Acked-by: Michal Hocko Thanks for catching this. Andrew, could you fold this into the original patch please? > --- > 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) > -- > 2.7.0 -- Michal Hocko SUSE Labs