Skip to content

Commit 48d0cf4

Browse files
Dan Carpenterrobclark
authored andcommitted
drm/msm/dp: Fix double free on error in msm_dp_bridge_init()
The "dp_bridge" pointer is allocated with devm_kzalloc() so it will be freed automatically. Kfreeing it here will only lead to a double free. Fixes: 8a3b4c1 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/20211215114900.GD14552@kili Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent 3789785 commit 48d0cf4

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/gpu/drm/msm/dp/dp_drm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi
243243
rc = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
244244
if (rc) {
245245
DRM_ERROR("failed to attach bridge, rc=%d\n", rc);
246-
kfree(dp_bridge);
247246
return ERR_PTR(rc);
248247
}
249248

0 commit comments

Comments
 (0)