All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/vmwgfx: Fix handling of errors returned by 'vmw_cotable_alloc()'
@ 2016-11-29  6:49 ` Christophe JAILLET
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2016-11-29  6:49 UTC (permalink / raw)
  To: linux-graphics-maintainer, syeh, thellstrom, airlied
  Cc: dri-devel, linux-kernel, kernel-janitors, Christophe JAILLET

'vmw_cotable_alloc()' returns an error pointer on error, not NULL.
Propagate the error code, instead of returning -ENOMEM unconditionally

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
index 443d1ed00de7..d1aee9860033 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
@@ -209,8 +209,8 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,
 		for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
 			uctx->cotables[i] = vmw_cotable_alloc(dev_priv,
 							      &uctx->res, i);
-			if (unlikely(uctx->cotables[i] == NULL)) {
-				ret = -ENOMEM;
+			if (unlikely(IS_ERR(uctx->cotables[i]))) {
+				ret = PTR_ERR(uctx->cotables[i]);
 				goto out_cotables;
 			}
 		}
-- 
2.9.3

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

* [PATCH] drm/vmwgfx: Fix handling of errors returned by 'vmw_cotable_alloc()'
@ 2016-11-29  6:49 ` Christophe JAILLET
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2016-11-29  6:49 UTC (permalink / raw)
  To: linux-graphics-maintainer, syeh, thellstrom, airlied
  Cc: dri-devel, linux-kernel, kernel-janitors, Christophe JAILLET

'vmw_cotable_alloc()' returns an error pointer on error, not NULL.
Propagate the error code, instead of returning -ENOMEM unconditionally

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
index 443d1ed00de7..d1aee9860033 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
@@ -209,8 +209,8 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,
 		for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
 			uctx->cotables[i] = vmw_cotable_alloc(dev_priv,
 							      &uctx->res, i);
-			if (unlikely(uctx->cotables[i] = NULL)) {
-				ret = -ENOMEM;
+			if (unlikely(IS_ERR(uctx->cotables[i]))) {
+				ret = PTR_ERR(uctx->cotables[i]);
 				goto out_cotables;
 			}
 		}
-- 
2.9.3


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

* Re: [PATCH] drm/vmwgfx: Fix handling of errors returned by 'vmw_cotable_alloc()'
  2016-11-29  6:49 ` Christophe JAILLET
  (?)
@ 2016-11-29 17:18   ` Sinclair Yeh
  -1 siblings, 0 replies; 5+ messages in thread
From: Sinclair Yeh @ 2016-11-29 17:18 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: linux-graphics-maintainer, thellstrom, airlied, dri-devel,
	linux-kernel, kernel-janitors

Good catch.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

On Tue, Nov 29, 2016 at 07:49:19AM +0100, Christophe JAILLET wrote:
> 'vmw_cotable_alloc()' returns an error pointer on error, not NULL.
> Propagate the error code, instead of returning -ENOMEM unconditionally
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
> index 443d1ed00de7..d1aee9860033 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
> @@ -209,8 +209,8 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,
>  		for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
>  			uctx->cotables[i] = vmw_cotable_alloc(dev_priv,
>  							      &uctx->res, i);
> -			if (unlikely(uctx->cotables[i] == NULL)) {
> -				ret = -ENOMEM;
> +			if (unlikely(IS_ERR(uctx->cotables[i]))) {
> +				ret = PTR_ERR(uctx->cotables[i]);
>  				goto out_cotables;
>  			}
>  		}
> -- 
> 2.9.3
> 

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

* Re: [PATCH] drm/vmwgfx: Fix handling of errors returned by 'vmw_cotable_alloc()'
@ 2016-11-29 17:18   ` Sinclair Yeh
  0 siblings, 0 replies; 5+ messages in thread
From: Sinclair Yeh @ 2016-11-29 17:18 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: thellstrom, kernel-janitors, linux-kernel, dri-devel,
	linux-graphics-maintainer

Good catch.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

On Tue, Nov 29, 2016 at 07:49:19AM +0100, Christophe JAILLET wrote:
> 'vmw_cotable_alloc()' returns an error pointer on error, not NULL.
> Propagate the error code, instead of returning -ENOMEM unconditionally
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
> index 443d1ed00de7..d1aee9860033 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
> @@ -209,8 +209,8 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,
>  		for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
>  			uctx->cotables[i] = vmw_cotable_alloc(dev_priv,
>  							      &uctx->res, i);
> -			if (unlikely(uctx->cotables[i] = NULL)) {
> -				ret = -ENOMEM;
> +			if (unlikely(IS_ERR(uctx->cotables[i]))) {
> +				ret = PTR_ERR(uctx->cotables[i]);
>  				goto out_cotables;
>  			}
>  		}
> -- 
> 2.9.3
> 

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

* Re: [PATCH] drm/vmwgfx: Fix handling of errors returned by 'vmw_cotable_alloc()'
@ 2016-11-29 17:18   ` Sinclair Yeh
  0 siblings, 0 replies; 5+ messages in thread
From: Sinclair Yeh @ 2016-11-29 17:18 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: thellstrom, kernel-janitors, linux-kernel, dri-devel,
	linux-graphics-maintainer

Good catch.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

On Tue, Nov 29, 2016 at 07:49:19AM +0100, Christophe JAILLET wrote:
> 'vmw_cotable_alloc()' returns an error pointer on error, not NULL.
> Propagate the error code, instead of returning -ENOMEM unconditionally
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
> index 443d1ed00de7..d1aee9860033 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
> @@ -209,8 +209,8 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,
>  		for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
>  			uctx->cotables[i] = vmw_cotable_alloc(dev_priv,
>  							      &uctx->res, i);
> -			if (unlikely(uctx->cotables[i] == NULL)) {
> -				ret = -ENOMEM;
> +			if (unlikely(IS_ERR(uctx->cotables[i]))) {
> +				ret = PTR_ERR(uctx->cotables[i]);
>  				goto out_cotables;
>  			}
>  		}
> -- 
> 2.9.3
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-11-29 18:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-29  6:49 [PATCH] drm/vmwgfx: Fix handling of errors returned by 'vmw_cotable_alloc()' Christophe JAILLET
2016-11-29  6:49 ` Christophe JAILLET
2016-11-29 17:18 ` Sinclair Yeh
2016-11-29 17:18   ` Sinclair Yeh
2016-11-29 17:18   ` Sinclair Yeh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.