Skip to contentSkip to conversation

drm: mxsfb: fix error return code in mxsfb_load()

PATCH In review Wei Yongjun 3 participants 3 messages Feb 5, 2017 – Feb 6, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: mxsfb: fix error return code in mxsfb_load()

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mxsfb/mxsfb_drv.c +1 -0
index cdfbe02..28a75cb 100644
@@ -221,6 +221,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
 	mxsfb->fbdev = drm_fbdev_cma_init(drm, 32,
 					  drm->mode_config.num_connector);
 	if (IS_ERR(mxsfb->fbdev)) {
+		ret = PTR_ERR(mxsfb->fbdev);
 		mxsfb->fbdev = NULL;
 		dev_err(drm->dev, "Failed to init FB CMA area\n");
 		goto err_cma;
Reviewed-by on v1 1/1
#1 lore raw

Hi Wei,

2017-02-05 Wei Yongjun <[email protected]>:

Quoted 15 lines

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mxsfb/mxsfb_drv.c +0 -0
index cdfbe02..28a75cb 100644

drivers/gpu/drm/mxsfb/mxsfb_drv.c static int mxsfb_load(struct drm_device *drm, unsigned long flags) · line 227

Quoted 7 lines
drivers/gpu/drm/mxsfb/mxsfb_drv.c +1 -0
@@ -221,6 +221,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
 	mxsfb->fbdev = drm_fbdev_cma_init(drm, 32,
 					  drm->mode_config.num_connector);
 	if (IS_ERR(mxsfb->fbdev)) {
+		ret = PTR_ERR(mxsfb->fbdev);
 		mxsfb->fbdev = NULL;
 		dev_err(drm->dev, "Failed to init FB CMA area\n");
 		goto err_cma;

Gustavo

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Wei Yongjun
Quoted 6 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Quoted 19 lines
---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mxsfb/mxsfb_drv.c +1 -0
index cdfbe02..28a75cb 100644
@@ -221,6 +221,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
 	mxsfb->fbdev = drm_fbdev_cma_init(drm, 32,
 					  drm->mode_config.num_connector);
 	if (IS_ERR(mxsfb->fbdev)) {
+		ret = PTR_ERR(mxsfb->fbdev);
 		mxsfb->fbdev = NULL;
 		dev_err(drm->dev, "Failed to init FB CMA area\n");
 		goto err_cma;
Signature · 2 lines
Best regards,
Marek Vasut