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

Commit 2a54c015 authored by Bojun Pan's avatar Bojun Pan Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: Fix KW P1 issue



KW tool detect the potential NULL access and buffer
index overflow issue.
The change is to add the proper handle for NULL response
and prevent buffer index overflow.

Change-Id: I0bb1b45ba6e5b0abe6c3539d451f74e19028737c
Signed-off-by: default avatarBojun Pan <bojunp@codeaurora.org>
parent 398c93fd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -384,6 +384,9 @@ static void ipa3_handle_mhi_vote_req(struct qmi_handle *qmi_handle,
					IPA_QMI_ERR_NOT_SUPPORTED_V01;
			}
			resp = &resp2;
		} else {
			IPAWANERR("clk_rate_valid is false\n");
			return;
		}
	} else {
		resp = imp_handle_vote_req(vote_req->mhi_vote);
+2 −2
Original line number Diff line number Diff line
@@ -403,10 +403,10 @@ static ssize_t ipa_ut_dbgfs_meta_test_read(struct file *file,
	meta_type = (long)(file->private_data);
	IPA_UT_DBG("Meta test type %ld\n", meta_type);

	buf = kmalloc(IPA_UT_DEBUG_READ_BUF_SIZE, GFP_KERNEL);
	buf = kmalloc(IPA_UT_DEBUG_READ_BUF_SIZE + 1, GFP_KERNEL);
	if (!buf) {
		IPA_UT_ERR("failed to allocate %d bytes\n",
			IPA_UT_DEBUG_READ_BUF_SIZE);
			IPA_UT_DEBUG_READ_BUF_SIZE + 1);
		cnt = 0;
		goto unlock_mutex;
	}