Re: [patch] drm/etnaviv: unlock on error in etnaviv_gem_get_iova()

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

 



> We have to drop a lock before returning -ENOMEM here.
> 
> Fixes: a8c21a5451d8 ('drm/etnaviv: add initial etnaviv DRM driver')
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index 8d6f859..9f77c3b 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -305,8 +305,10 @@ int etnaviv_gem_get_iova(struct etnaviv_gpu *gpu,
>  	mapping = etnaviv_gem_get_vram_mapping(etnaviv_obj, NULL);
>  	if (!mapping) {
>  		mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
> -		if (!mapping)
> -			return -ENOMEM;
> +		if (!mapping) {
> +			ret = -ENOMEM;
> +			goto out;
> +		}
>  
>  		INIT_LIST_HEAD(&mapping->scan_node);
>  		mapping->object = etnaviv_obj;

How do you think about to reuse the jump label "unlock" there
like it is used in other source files?
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/etnaviv/etnaviv_gem.c?id=a8c21a5451d831e67b7a6fb910f9ca8bc7b43554#n263

Regards,
Markus
_______________________________________________
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