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

Commit 4de4d88d authored by Mohammed Javid's avatar Mohammed Javid Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: fix wrong usage and cleanup dead code



Couple of code cleanup
  - remove dead code
  - initialize local variables before use
  - validate gsi_ep_cfg_ptr return

Change-Id: Ia2c2a5559fa2c5f89b33cc1ff897df0faa725e7e
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
parent 780c4f61
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -644,6 +644,12 @@ int ipa3_request_gsi_channel(struct ipa_request_gsi_channel_params *params,
	}

	gsi_ep_cfg_ptr = ipa3_get_gsi_ep_info(ep->client);
	if (gsi_ep_cfg_ptr == NULL) {
		IPAERR("Error ipa3_get_gsi_ep_info ret NULL\n");
		result = -EFAULT;
		goto write_evt_scratch_fail;
	}

	params->chan_params.evt_ring_hdl = ep->gsi_evt_ring_hdl;
	params->chan_params.ch_id = gsi_ep_cfg_ptr->ipa_gsi_chan_num;
	gsi_res = gsi_alloc_channel(&params->chan_params, gsi_dev_hdl,
+1 −4
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ static int ipa3_mhi_get_ch_poll_cfg(enum ipa_client_type client,
static int ipa_mhi_start_gsi_channel(enum ipa_client_type client,
	int ipa_ep_idx, struct start_gsi_channel *params)
{
	int res;
	int res = 0;
	struct gsi_evt_ring_props ev_props;
	struct ipa_mhi_msi_info *msi;
	struct gsi_chan_props ch_props;
@@ -241,7 +241,6 @@ static int ipa_mhi_start_gsi_channel(enum ipa_client_type client,
		if (res) {
			IPA_MHI_ERR("gsi_alloc_evt_ring failed %d\n", res);
			goto fail_alloc_evt;
			return res;
		}
		IPA_MHI_DBG("client %d, caching event ring hdl %lu\n",
				client,
@@ -259,7 +258,6 @@ static int ipa_mhi_start_gsi_channel(enum ipa_client_type client,
		IPA_MHI_ERR("event ring wp is not updated. base=wp=0x%llx\n",
			params->ev_ctx_host->wp);
		goto fail_alloc_ch;
		return res;
	}

	IPA_MHI_DBG("Ring event db: evt_ring_hdl=%lu host_wp=0x%llx\n",
@@ -270,7 +268,6 @@ static int ipa_mhi_start_gsi_channel(enum ipa_client_type client,
		IPA_MHI_ERR("fail to ring evt ring db %d. hdl=%lu wp=0x%llx\n",
			res, ep->gsi_evt_ring_hdl, params->ev_ctx_host->wp);
		goto fail_alloc_ch;
		return res;
	}

	memset(&ch_props, 0, sizeof(ch_props));