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

Commit d84295c3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: glink: Free if_ptr before freeing dummy transport"

parents ab2cc234 ced1f060
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -3767,6 +3767,8 @@ static void glink_dummy_xprt_ctx_release(struct rwref_lock *xprt_st_lock)
	GLINK_INFO("%s: freeing transport [%s->%s]context\n", __func__,
				xprt_ctx->name,
				xprt_ctx->edge);
	kfree(xprt_ctx->ops);
	xprt_ctx->ops = NULL;
	kfree(xprt_ctx);
}

@@ -4158,6 +4160,7 @@ static void glink_core_link_down(struct glink_transport_if *if_ptr)
	rwref_write_get(&xprt_ptr->xprt_state_lhb0);
	xprt_ptr->next_lcid = 1;
	xprt_ptr->local_state = GLINK_XPRT_DOWN;
	xprt_ptr->curr_qos_rate_kBps = 0;
	xprt_ptr->local_version_idx = xprt_ptr->versions_entries - 1;
	xprt_ptr->remote_version_idx = xprt_ptr->versions_entries - 1;
	xprt_ptr->l_features =
@@ -4292,6 +4295,12 @@ static void glink_core_channel_cleanup(struct glink_core_xprt_ctx *xprt_ptr)
	rwref_read_get(&xprt_ptr->xprt_state_lhb0);
	ctx = get_first_ch_ctx(xprt_ptr);
	while (ctx) {
		spin_lock_irqsave(&xprt_ptr->tx_ready_lock_lhb3, flags);
		spin_lock(&ctx->tx_lists_lock_lhc3);
		if (!list_empty(&ctx->tx_active))
			glink_qos_done_ch_tx(ctx);
		spin_unlock(&ctx->tx_lists_lock_lhc3);
		spin_unlock_irqrestore(&xprt_ptr->tx_ready_lock_lhb3, flags);
		rwref_write_get_atomic(&ctx->ch_state_lhb2, true);
		if (ctx->local_open_state == GLINK_CHANNEL_OPENED ||
			ctx->local_open_state == GLINK_CHANNEL_OPENING) {