mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: use ERR_PTR() to return from amdgpu_mn_get
@ 2016-04-28  9:33 Arnd Bergmann
  2016-04-28 10:06 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-04-28  9:33 UTC (permalink / raw)
  To: Alex Deucher, Michal Hocko
  Cc: Arnd Bergmann, Christian König, David Airlie,
	Felix Kuehling, Jammy Zhou, Monk Liu, Jack Xiao, dri-devel,
	linux-kernel

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 <arnd@arndb.de>
Fixes: ad35eee9fb17 ("drm/amdgpu: make amdgpu_mn_get wait for mmap_sem killable")
---
 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amdgpu: use ERR_PTR() to return from amdgpu_mn_get
  2016-04-28  9:33 [PATCH] drm/amdgpu: use ERR_PTR() to return from amdgpu_mn_get Arnd Bergmann
@ 2016-04-28 10:06 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2016-04-28 10:06 UTC (permalink / raw)
  To: Arnd Bergmann, Andrew Morton
  Cc: Alex Deucher, Christian König, David Airlie, Felix Kuehling,
	Jammy Zhou, Monk Liu, Jack Xiao, dri-devel, linux-kernel

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 <arnd@arndb.de>
> 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 <mhocko@suse.com>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-28 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-28  9:33 [PATCH] drm/amdgpu: use ERR_PTR() to return from amdgpu_mn_get Arnd Bergmann
2016-04-28 10:06 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®