Skip to content

Commit 5a2c920

Browse files
JuliaLawallMark Yao
authored andcommitted
drm/rockchip: return ERR_PTR instead of NULL
rockchip_drm_framebuffer_init is only used in one case, in rockchip_drm_fbdev.c, where its return value is tested using IS_ERR. To enable propagating the reason for the error, change the definition so that it returns an ERR_PTR value. Problem found with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
1 parent 17a794d commit 5a2c920

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/gpu/drm/rockchip/rockchip_drm_fb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ rockchip_drm_framebuffer_init(struct drm_device *dev,
213213

214214
rockchip_fb = rockchip_fb_alloc(dev, mode_cmd, &obj, 1);
215215
if (IS_ERR(rockchip_fb))
216-
return NULL;
216+
return ERR_CAST(rockchip_fb);
217217

218218
return &rockchip_fb->fb;
219219
}

0 commit comments

Comments
 (0)