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

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

Merge "diag: Add protection before accessing md_session_map"

parents f93ed45f 4f36d854
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1752,15 +1752,18 @@ static int diag_switch_logging(struct diag_logging_mode_param_t *param)

		i = upd - UPD_WLAN;

		mutex_lock(&driver->md_session_lock);
		if (driver->md_session_map[peripheral] &&
			(MD_PERIPHERAL_MASK(peripheral) &
			diag_mux->mux_mask) &&
			!driver->pd_session_clear[i]) {
			DIAG_LOG(DIAG_DEBUG_USERSPACE,
			"diag_fr: User PD is already logging onto active peripheral logging\n");
			mutex_unlock(&driver->md_session_lock);
			driver->pd_session_clear[i] = 0;
			return -EINVAL;
		}
		mutex_unlock(&driver->md_session_lock);
		peripheral_mask =
			diag_translate_mask(param->pd_mask);
		param->peripheral_mask = peripheral_mask;