drm/imx: drm_dev_alloc() returns error pointers
Subsystems (4)
PATCH 1/1 drm/imx: drm_dev_alloc() returns error pointers
We are checking for NULL here, when we should be checking for error pointers.
Fixes 54db5decce17 ("drm/imx: drop deprecated load/unload drm_driver ops")
Signed-off-by Dan Carpenter <[email protected]>
drivers/gpu/drm/imx/imx-drm-core.c +2 -2
@@ -357,8 +357,8 @@ static int imx_drm_bind(struct device *dev)int ret; drm =drm_dev_alloc (&imx_drm_driver, dev); -if (!drm) -return -ENOMEM ; +if (IS_ERR (drm)) +return PTR_ERR (drm); imxdrm =devm_kzalloc (dev,sizeof (*imxdrm),GFP_KERNEL );if (!imxdrm) {
Am Donnerstag, den 13.10.2016, 11:53 +0300 schrieb Dan Carpenter:
Quoted 6 lines
We are checking for NULL here, when we should be checking for error pointers.
Fixes 54db5decce17 ("drm/imx: drop deprecated load/unload drm_driverops")
Signed-off-by Dan Carpenter <[email protected]>
Reviewed-by Lucas Stach <[email protected]>
Quoted 17 lines
drivers/gpu/drm/imx/imx-drm-core.c +0
-0@@ -357,8 +357,8 @@ static int imx_drm_bind(struct device *dev) int ret;
drm =drm_dev_alloc(&imx_drm_driver, dev);drivers/gpu/drm/imx/imx-drm-core.c +2
-2-if (!drm) -return -ENOMEM ; +if (IS_ERR (drm)) +return PTR_ERR (drm);
imxdrm =devm_kzalloc(dev, sizeof(*imxdrm), GFP_KERNEL); if (!imxdrm) {
Philipp Zabel
AppliedAm Donnerstag, den 13.10.2016, 11:53 +0300 schrieb Dan Carpenter:
Quoted 11 lines
We are checking for NULL here, when we should be checking for error pointers.
Fixes 54db5decce17 ("drm/imx: drop deprecated load/unload drm_driver ops")Signed-off-by Dan Carpenter <[email protected]>drivers/gpu/drm/imx/imx-drm-core.c +0
-0
drivers/gpu/drm/imx/imx-drm-core.c static int imx_drm_bind(struct device *dev) · line 364
Quoted 10 lines
drivers/gpu/drm/imx/imx-drm-core.c +2
-2@@ -357,8 +357,8 @@ static int imx_drm_bind(struct device *dev)int ret; drm =drm_dev_alloc (&imx_drm_driver, dev); -if (!drm) -return -ENOMEM ; +if (IS_ERR (drm)) +return PTR_ERR (drm); imxdrm =devm_kzalloc (dev,sizeof (*imxdrm),GFP_KERNEL );if (!imxdrm) {
Applied, thanks.
regards
Philipp