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

Commit 9fcb976e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Sanitize the proc values against NUM_DIAG_MD_DEV"

parents a21a2784 38231618
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1038,7 +1038,7 @@ static int diag_send_raw_data_remote(int proc, void *buf, int len,
	CONTROL_CHAR, NON_HDLC_VERSION, 0, 0 };
	unsigned char end_byte[1] = { CONTROL_CHAR };

	if (!buf)
	if (!buf || proc <= 0 || proc >= NUM_DIAG_MD_DEV)
		return -EINVAL;

	if (len <= 0) {
@@ -3478,7 +3478,7 @@ static int diag_user_process_raw_data(const char __user *buf, int len)
			return -EFAULT;
		}
	}
	if (remote_proc) {
	if (remote_proc && (remote_proc < NUM_DIAG_MD_DEV)) {
		ret = diag_send_raw_data_remote(remote_proc,
				(void *)(user_space_data + token_offset),
				len, USER_SPACE_RAW_DATA);
+1 −1
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ static void mhi_buf_tbl_clear(struct diag_mhi_info *mhi_info)
	struct diag_mhi_buf_tbl_t *item = NULL;
	struct diag_mhi_buf_tbl_t *tp = NULL, *tp_temp = NULL;
	struct diag_mhi_ch_t *ch = NULL;
	unsigned char *buf;
	unsigned char *buf = NULL;

	if (!mhi_info || !mhi_info->enabled)
		return;
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -1133,7 +1133,7 @@ int diag_socket_init(void)
		nb = &restart_notifiers[i];
		handle = subsys_notif_register_notifier(nb->name, &nb->nb);
		DIAG_LOG(DIAG_DEBUG_PERIPHERALS,
			 "%s: registering notifier for '%s', handle=%p\n",
			 "%s: registering notifier for '%s', handle=%pK\n",
			 __func__, nb->name, handle);
	}