Skip to contentSkip to conversation

drm/hisilicon/hibmc: Fix wrong pointer passed to PTR_ERR()

PATCH In review Wei Yongjun 2 participants 2 messages Jan 12, 2017 – Jan 16, 2017

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

PATCH 1/1 drm/hisilicon/hibmc: Fix wrong pointer passed to PTR_ERR()

From: Wei Yongjun <[email protected]>

PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned.

Fixes d1667b86795a ("drm/hisilicon/hibmc: Add support for frame buffer")
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c +1 -1
index 7a6957a..16fe790 100644
@@ -121,7 +121,7 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper,
 
 	hi_fbdev->fb = hibmc_framebuffer_init(priv->dev, &mode_cmd, gobj);
 	if (IS_ERR(hi_fbdev->fb)) {
-		ret = PTR_ERR(info);
+		ret = PTR_ERR(hi_fbdev->fb);
 		DRM_ERROR("failed to initialize framebuffer: %d\n", ret);
 		goto out_release_fbi;
 	}
Reviewed-by on v1 1/1
#1 lore raw

Hi Wei,

2017-01-12 Wei Yongjun <[email protected]>:

Quoted 7 lines

From: Wei Yongjun <[email protected]>

PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned.

Fixes d1667b86795a ("drm/hisilicon/hibmc: Add support for frame buffer")

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