drm: sti: Fix return value check in sti_drm_platform_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 26 Aug 2014 10:24:24 +0000 (12:24 +0200)
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>
Tue, 26 Aug 2014 12:16:51 +0000 (14:16 +0200)
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 <yongjun_wei@trendmicro.com.cn>
drivers/gpu/drm/sti/sti_drm_drv.c

index a7cc24917a96c39d9179e55744703171142c3bf5..223d93c3a05d8d7241ad05b669562d0a160af4fa 100644 (file)
@@ -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;