Re: [patch] drm: mxsfb: drm_dev_alloc() returns error pointers

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

 



On 12/13/2016 01:23 PM, Dan Carpenter wrote:
> We should be checking for IS_ERR() instead of NULL because
> drm_dev_alloc() returns error pointers.
> 
> Fixes: 45d59d704080 ("drm: Add new driver for MXSFB controller")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Thanks,

Reviewed-by: Marek Vasut <marex@xxxxxxx>

> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 79a18bf48b54..955441f71500 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -395,8 +395,8 @@ static int mxsfb_probe(struct platform_device *pdev)
>  		pdev->id_entry = of_id->data;
>  
>  	drm = drm_dev_alloc(&mxsfb_driver, &pdev->dev);
> -	if (!drm)
> -		return -ENOMEM;
> +	if (IS_ERR(drm))
> +		return PTR_ERR(drm);
>  
>  	ret = mxsfb_load(drm, 0);
>  	if (ret)
> 


-- 
Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux