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

Commit 42f0e4a8 authored by Katish Paran's avatar Katish Paran
Browse files

diag: Remove invalid check for payload



Call back data type does support commands which is less than
4 bytes in size. This patch removes the unnecessary check for
the call back data type.

Change-Id: Ie70196d8dd0b0b3d023bc2505fbb1cb3e582a1af
CRs-fixed: 623552
Signed-off-by: default avatarKatish Paran <kparan@codeaurora.org>
parent f537ef9a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1494,8 +1494,7 @@ static ssize_t diagchar_write(struct file *file, const char __user *buf,
		return err;
	}
	if (pkt_type == CALLBACK_DATA_TYPE) {
		if (payload_size > driver->itemsize ||
				payload_size <= MIN_SIZ_ALLOW) {
		if (payload_size > driver->itemsize) {
			pr_err("diag: Dropping packet, invalid packet size. Current payload size %d\n",
				payload_size);
			driver->dropped_count++;
@@ -1527,6 +1526,11 @@ static ssize_t diagchar_write(struct file *file, const char __user *buf,
			return ret;
		}
		/* The packet is for the remote processor */
		if (payload_size <= MIN_SIZ_ALLOW) {
				pr_err("diag: Integer underflow in %s, payload size: %d",
							__func__, payload_size);
			return -EBADMSG;
		}
		token_offset = 4;
		payload_size -= 4;
		buf += 4;