Re: [PATCH] drm/msm: Error pointer dereference in error handling

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

 



On Fri, Aug 11, 2017 at 11:15:35PM +0300, Dan Carpenter wrote:
> "gpu->aspace" can be either an error pointer or NULL so we need to check
> for both.
> 
> Fixes: 0dbd7327f4d5 ("drm/msm: Move memptrs to msm_gpu")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index 66af5ac334ba..156ad7d5c68a 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -775,7 +775,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>  		drm_gem_object_unreference_unlocked(gpu->memptrs_bo);
>  	}
>  
> -	if (gpu->aspace) {
> +	if (!IS_ERR_OR_NULL(gpu->aspace)) {
>  		gpu->aspace->mmu->funcs->detach(gpu->aspace->mmu,
>  			NULL, 0);
>  		msm_gem_address_space_put(gpu->aspace);

Yep, thats clearly a paddlin'.  Thanks.

Acked-by: Jordan Crouse <jcrouse@xxxxxxxxxxxxxxx>

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://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