From: Wei Yongjun Date: Tue, 26 Aug 2014 10:24:24 +0000 (+0200) Subject: drm: sti: Fix return value check in sti_drm_platform_probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eacd9aa98bdeef5ba19072d3f07dfcccd24988f2;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drm: sti: Fix return value check in sti_drm_platform_probe() In case of error, the function platform_device_register_resndata() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- diff --git a/drivers/gpu/drm/sti/sti_drm_drv.c b/drivers/gpu/drm/sti/sti_drm_drv.c index a7cc24917a96..223d93c3a05d 100644 --- a/drivers/gpu/drm/sti/sti_drm_drv.c +++ b/drivers/gpu/drm/sti/sti_drm_drv.c @@ -201,8 +201,8 @@ static int sti_drm_platform_probe(struct platform_device *pdev) master = platform_device_register_resndata(dev, DRIVER_NAME "__master", -1, NULL, 0, NULL, 0); - if (!master) - return -EINVAL; + if (IS_ERR(master)) + return PTR_ERR(master); platform_set_drvdata(pdev, master); return 0;