diff mbox

drm/vmwgfx: fix error return code in vmw_driver_load()

Message ID CAPgLHd-6AP74UFPzxU0dz2y+JyPSL1w+x5zd_hXCVLOuws8AYQ@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Aug. 26, 2013, 7:15 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return -ENOMEM in the fence manager init error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Dmitry Torokhov Aug. 26, 2013, 7:56 a.m. UTC | #1
On Monday, August 26, 2013 03:15:37 PM Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return -ENOMEM in the fence manager init error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Acked-by: Dmitry Torokhov <dtor@vmware.com>

> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 78e2164..6dafefc 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -622,8 +622,10 @@ static int vmw_driver_load(struct drm_device *dev,
> unsigned long chipset) }
> 
>  	dev_priv->fman = vmw_fence_manager_init(dev_priv);
> -	if (unlikely(dev_priv->fman == NULL))
> +	if (unlikely(dev_priv->fman == NULL)) {
> +		ret = -ENOMEM;
>  		goto out_no_fman;
> +	}
> 
>  	vmw_kms_save_vga(dev_priv);
diff mbox

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 78e2164..6dafefc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -622,8 +622,10 @@  static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
 	}
 
 	dev_priv->fman = vmw_fence_manager_init(dev_priv);
-	if (unlikely(dev_priv->fman == NULL))
+	if (unlikely(dev_priv->fman == NULL)) {
+		ret = -ENOMEM;
 		goto out_no_fman;
+	}
 
 	vmw_kms_save_vga(dev_priv);