[PATCHv4 22/36] drm/komeda: Move helper invocation to after size checks
Andrzej Pietrasiewicz
andrzej.p at collabora.com
Fri Dec 13 15:58:53 UTC 2019
Between the old and new place nothing depends on data retrieved with the
helper, so it is safe to move its invocation.
The err_cleanup case is changed accordingly.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p at collabora.com>
---
drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
index ab067f89533c..1a03318ec73a 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
@@ -155,7 +155,6 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file,
if (ret < 0)
goto err_free;
- drm_helper_mode_fill_fb_struct(dev, &kfb->base, mode_cmd);
info = drm_get_format_info(dev, mode_cmd);
if (mode_cmd->modifier[0]) {
@@ -186,6 +185,8 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file,
goto err_cleanup;
}
+ drm_helper_mode_fill_fb_struct(dev, &kfb->base, mode_cmd);
+
for (i = 0; i < info->num_planes; ++i)
kfb->base.obj[i] = objs[i];
@@ -201,7 +202,7 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file,
return &kfb->base;
err_cleanup:
- for (i = 0; i < kfb->base.format->num_planes; i++)
+ for (i = 0; i < info->num_planes; i++)
drm_gem_object_put_unlocked(objs[i]);
err_free:
kfree(kfb);
--
2.17.1
More information about the dri-devel
mailing list