Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c255e98 authored by Brian Norris's avatar Brian Norris Committed by Greg Kroah-Hartman
Browse files

drm/panel: kingdisplay-kd097d04: Delete panel on attach() failure



[ Upstream commit 5f31dbeae8a88f31c3eb4eb526ab4807c40da241 ]

If we fail to attach (e.g., because 1 of 2 dual-DSI controllers aren't
ready), we leave a dangling drm_panel reference to freed memory. Clean
that up on failure.

Fixes: 2a994cbe ("drm/panel: Add Kingdisplay KD097D04 panel driver")
Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210923173336.1.Icb4d9dbc1817f4e826361a4f1cea7461541668f0@changeid


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5cc7480e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -424,7 +424,13 @@ static int kingdisplay_panel_probe(struct mipi_dsi_device *dsi)
	if (err < 0)
		return err;

	return mipi_dsi_attach(dsi);
	err = mipi_dsi_attach(dsi);
	if (err < 0) {
		kingdisplay_panel_del(kingdisplay);
		return err;
	}

	return 0;
}

static int kingdisplay_panel_remove(struct mipi_dsi_device *dsi)