From: Wei Yongjun Date: Fri, 25 Oct 2013 09:07:18 +0000 (+0800) Subject: staging: drm/imx: fix return value check in imx_drm_init() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2eaaccdeabf34ad70ecb7eb9c4aafa08b13a0e66;p=linux-beck.git staging: drm/imx: fix return value check in imx_drm_init() In case of error, the function platform_device_register_simple() 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 Acked-by: Sascha Hauer Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c index d2fb699c0d1d..4483d47f7395 100644 --- a/drivers/staging/imx-drm/imx-drm-core.c +++ b/drivers/staging/imx-drm/imx-drm-core.c @@ -852,8 +852,8 @@ static int __init imx_drm_init(void) INIT_LIST_HEAD(&imx_drm_device->encoder_list); imx_drm_pdev = platform_device_register_simple("imx-drm", -1, NULL, 0); - if (!imx_drm_pdev) { - ret = -EINVAL; + if (IS_ERR(imx_drm_pdev)) { + ret = PTR_ERR(imx_drm_pdev); goto err_pdev; }