[patch] drm/exynos: IS_ERR() vs NULL bug

Gustavo Padovan gustavo at padovan.org
Fri Feb 20 05:12:48 PST 2015


Hi Dan,

2015-02-20 Dan Carpenter <dan.carpenter at oracle.com>:

> of_iomap() doesn't return error pointers, it returns NULL on error.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
> 
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index 63f02e2..9700461 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -888,8 +888,8 @@ static int decon_probe(struct platform_device *pdev)
>  	of_node_put(i80_if_timings);
>  
>  	ctx->regs = of_iomap(dev->of_node, 0);
> -	if (IS_ERR(ctx->regs)) {
> -		ret = PTR_ERR(ctx->regs);
> +	if (!ctx->regs) {
> +		ret = -ENOMEM;
>  		goto err_del_component;
>  	}

Reviewed-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>

	Gustavo


More information about the dri-devel mailing list