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

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

Merge "msm: mhi_dev: Error notifications for Invalid Channels"

parents 00a33441 63509b4a
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1085,8 +1085,10 @@ static void mhi_dev_trigger_cb(enum mhi_client_channel ch_id)
	enum mhi_ctrl_info state_data;

	/* Currently no clients register for HW channel notify */
	if (ch_id >= MHI_MAX_SOFTWARE_CHANNELS)
	if (ch_id >= MHI_MAX_SOFTWARE_CHANNELS) {
		mhi_log(MHI_MSG_ERROR, "Invalid channel :%d\n", ch_id);
		return;
	}

	list_for_each_entry(info, &mhi_ctx->client_cb_list, list)
		if (info->cb && info->cb_data.channel == ch_id) {
@@ -2936,7 +2938,7 @@ int mhi_register_state_cb(void (*mhi_state_cb)
	}

	if (channel >= MHI_MAX_SOFTWARE_CHANNELS) {
		pr_err("Invalid channel :%d\n", channel);
		mhi_log(MHI_MSG_ERROR, "Invalid channel :%d\n", channel);
		return -EINVAL;
	}

@@ -2976,8 +2978,10 @@ static void mhi_update_state_info(uint32_t uevent_idx, enum mhi_ctrl_info info)
	struct mhi_dev_client_cb_reason reason;

	/* Currently no clients register for HW channel notify */
	if (uevent_idx >= MHI_MAX_SOFTWARE_CHANNELS)
	if (uevent_idx >= MHI_MAX_SOFTWARE_CHANNELS) {
		mhi_log(MHI_MSG_ERROR, "Invalid channel :%d\n", uevent_idx);
		return;
	}

	if (uevent_idx == MHI_DEV_UEVENT_CTRL)
		mhi_ctx->ctrl_info = info;
@@ -3000,8 +3004,10 @@ int mhi_ctrl_state_info(uint32_t idx, uint32_t *info)
	else
		if (idx < MHI_MAX_SOFTWARE_CHANNELS)
			*info = channel_state_info[idx].ctrl_info;
		else
		else {
			mhi_log(MHI_MSG_ERROR, "Invalid channel :%d\n", idx);
			return -EINVAL;
		}

	mhi_log(MHI_MSG_VERBOSE, "idx:%d, ctrl:%d", idx, *info);