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

Commit 1e0f27bc authored by Andrei Danaila's avatar Andrei Danaila Committed by Matt Wagantall
Browse files

mhi: core: Resolve static analysis issues



Address static analysis issues.

Change-Id: I21e1d05cab2e8899c105ae2bc81d85ec62ec7df7
Signed-off-by: default avatarAndrei Danaila <adanaila@codeaurora.org>
parent 30a98b63
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -246,11 +246,12 @@ static enum MHI_STATUS mhi_init_device_ctrl(struct mhi_device_ctxt
	u32 align_len = sizeof(u64)*2;
	enum MHI_STATUS ret_val = MHI_STATUS_SUCCESS;

	mhi_dev_ctxt->enable_lpm = 1;
	if (NULL == mhi_dev_ctxt || NULL == mhi_dev_ctxt->mhi_ctrl_seg_info ||
			NULL == mhi_dev_ctxt->mhi_ctrl_seg_info->dev)
		return MHI_STATUS_ERROR;

	mhi_dev_ctxt->enable_lpm = 1;

	mhi_log(MHI_MSG_INFO, "Allocating control segment.\n");
	ctrl_seg_size += sizeof(struct mhi_control_seg);
	/* Calculate the size of the control segment needed */
+8 −5
Original line number Diff line number Diff line
@@ -277,8 +277,7 @@ enum MHI_STATUS mhi_register_channel(struct mhi_client_handle **client_handle,
		struct mhi_client_info_t *client_info, void *UserData)
{
	enum MHI_STATUS ret_val = MHI_STATUS_SUCCESS;
	struct mhi_device_ctxt *mhi_dev_ctxt =
		&(mhi_devices.device_list[device_index].mhi_ctxt);
	struct mhi_device_ctxt *mhi_dev_ctxt = NULL;

	if (!VALID_CHAN_NR(chan)) {
		ret_val = MHI_STATUS_INVALID_CHAN_ERR;
@@ -289,6 +288,8 @@ enum MHI_STATUS mhi_register_channel(struct mhi_client_handle **client_handle,
		ret_val = MHI_STATUS_ERROR;
		goto error_handle;
	}
	mhi_dev_ctxt = &(mhi_devices.device_list[device_index].mhi_ctxt);

	if (NULL != mhi_dev_ctxt->client_handle_list[chan])
		return MHI_STATUS_ALREADY_REGISTERED;

@@ -1409,13 +1410,15 @@ int mhi_set_bus_request(struct mhi_device_ctxt *mhi_dev_ctxt,

enum MHI_STATUS mhi_deregister_channel(struct mhi_client_handle
							*client_handle) {
	if (NULL == client_handle ||
	    client_handle->magic != MHI_HANDLE_MAGIC)
	enum MHI_STATUS ret_val = MHI_STATUS_SUCCESS;
	if (NULL == client_handle)
		return MHI_STATUS_ERROR;
	client_handle->mhi_dev_ctxt->client_handle_list[client_handle->chan] =
									NULL;
	if (client_handle->magic != MHI_HANDLE_MAGIC)
		ret_val = MHI_STATUS_ERROR;
	kfree(client_handle);
	return MHI_STATUS_SUCCESS;
	return ret_val;
}
EXPORT_SYMBOL(mhi_deregister_channel);