Re: [patch] drm/vmwgfx: add error checking for kmalloc()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/11/2014 05:04 PM, Dan Carpenter wrote:
> Return -ENOMEM if kmalloc() fails.
>
> Fixes: d5bde956630b ('drm/vmwgfx: Emulate legacy shaders on guest-backed devices v2')
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
> index 217d941b8176..23a32fd59a57 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
> @@ -779,6 +779,8 @@ vmw_compat_shader_man_create(struct vmw_private *dev_priv)
>  	int ret;
>  
>  	man = kzalloc(sizeof(*man), GFP_KERNEL);
> +	if (!man)
> +		return ERR_PTR(-ENOMEM);
>  
>  	man->dev_priv = dev_priv;
>  	INIT_LIST_HEAD(&man->list);

Thanks, Dan.
A patch fixing the same problem has already been queued for the next
vmwgfx-fixes!

/Thomas
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux