This patch improves bailout path of dpu_plane_init().
As we'll add more drm properties to the planes later,
this would simply the code.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit
1a6ab9246b5d6e71e8a4a0a0b5ea15d7af0c9879)
ARRAY_SIZE(dpu_overlay_formats),
dpu_format_modifiers,
type, NULL);
- if (ret) {
- kfree(dpu_plane);
- return ERR_PTR(ret);
- }
+ if (ret)
+ goto err;
drm_plane_helper_add(plane, &dpu_plane_helper_funcs);
ret = -EINVAL;
}
- if (ret) {
- kfree(dpu_plane);
- return ERR_PTR(ret);
- }
+ if (ret)
+ goto err;
return dpu_plane;
+
+err:
+ kfree(dpu_plane);
+ return ERR_PTR(ret);
}