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

Commit 44a7e6b8 authored by Hardik Arya's avatar Hardik Arya
Browse files

diag: Release diag wakesource on socket error



There is a possibility of exiting socket read and
not releasing diag wakesource due to socket error
at the time of connection reset. The patch releases
diag wakesource on socket error.

Change-Id: I9862395207f2dc2f723b06e176ba25bd001c189d
Signed-off-by: default avatarHardik Arya <harya@codeaurora.org>
parent eabcd830
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -597,12 +597,14 @@ static void socket_read_work_fn(struct work_struct *work)
						     struct diag_socket_info,
						     read_work);

	if (!info)
	if (!info) {
		diag_ws_release();
		return;

	}
	mutex_lock(&info->socket_info_mutex);
	if (!info->hdl || !info->hdl->sk) {
		mutex_unlock(&info->socket_info_mutex);
		diag_ws_release();
		return;
	}
	err = sock_error(info->hdl->sk);
@@ -611,6 +613,7 @@ static void socket_read_work_fn(struct work_struct *work)
		socket_close_channel(info);
		if (info->port_type == PORT_TYPE_SERVER)
			socket_init_work_fn(&info->init_work);
		diag_ws_release();
		return;
	}