Skip to content

Commit 2b245c9

Browse files
committed
drm/dp_mst: Reset message rx state after OOM in drm_dp_mst_handle_up_req()
After an out-of-memory error the reception state should be reset, so that the next attempt receiving a message doesn't fail (due to getting a start-of-message packet, while the reception state has already the start-of-message flag set). Cc: Lyude Paul <lyude@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241203160223.2926014-7-imre.deak@intel.com
1 parent e54b000 commit 2b245c9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/gpu/drm/display/drm_dp_mst_topology.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4110,6 +4110,7 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
41104110
{
41114111
struct drm_dp_pending_up_req *up_req;
41124112
struct drm_dp_mst_branch *mst_primary;
4113+
int ret = 0;
41134114

41144115
if (!drm_dp_get_one_sb_msg(mgr, true, NULL))
41154116
goto out_clear_reply;
@@ -4118,8 +4119,10 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
41184119
return 0;
41194120

41204121
up_req = kzalloc(sizeof(*up_req), GFP_KERNEL);
4121-
if (!up_req)
4122-
return -ENOMEM;
4122+
if (!up_req) {
4123+
ret = -ENOMEM;
4124+
goto out_clear_reply;
4125+
}
41234126

41244127
INIT_LIST_HEAD(&up_req->next);
41254128

@@ -4186,7 +4189,7 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
41864189
drm_dp_mst_topology_put_mstb(mst_primary);
41874190
out_clear_reply:
41884191
memset(&mgr->up_req_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
4189-
return 0;
4192+
return ret;
41904193
}
41914194

41924195
static void update_msg_rx_state(struct drm_dp_mst_topology_mgr *mgr)

0 commit comments

Comments
 (0)