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

Commit b9fce56a authored by Katish Paran's avatar Katish Paran Committed by Gerrit - the friendly Code Review server
Browse files

diag: Clear the remote address to avoid writing to stale port



Currently apps diag is not clearing the remote port address in
case peripheral subsystem restart has happened. If the remote
address is not cleared, write to a stale address may happen.

Change-Id: Idfd788d6a10c6b9b91b9d318718c0f24bb751717
Signed-off-by: default avatarKatish Paran <kparan@codeaurora.org>
parent b755738d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ void diag_cntl_channel_close(struct diagfwd_info *p_info)
	driver->stm_state[peripheral] = DISABLE_STM;
	driver->stm_state_requested[peripheral] = DISABLE_STM;
	reg_dirty ^= PERIPHERAL_MASK(peripheral);
	flush_workqueue(driver->cntl_wq);
}

static void diag_stm_update_work_fn(struct work_struct *work)
+1 −0
Original line number Diff line number Diff line
@@ -438,6 +438,7 @@ static void __socket_close_channel(struct diag_socket_info *info)
	if (!atomic_read(&info->opened))
		return;

	memset(&info->remote_addr, 0, sizeof(struct sockaddr_msm_ipc));
	diagfwd_channel_close(info->fwd_ctxt);

	atomic_set(&info->opened, 0);