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

Commit c70d0ba0 authored by Hardik Arya's avatar Hardik Arya Committed by Manoj Prabhu B
Browse files

diag: Do not update attribute of socket while closing channel



Currently while closing the socket channel we are updating
attributes of socket handle which is already being done
by calling sock release. The patch removes the cleanup
of the same from socket channel close.

Change-Id: I05c8677c2f96c6437c4ce11153ff18577baed28e
Signed-off-by: default avatarHardik Arya <harya@codeaurora.org>
parent 257d632c
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -495,7 +495,7 @@ static void __socket_close_channel(struct diag_socket_info *info)
{
	unsigned long flags;

	if (!info || !info->hdl)
	if (!info)
		return;

	memset(&info->remote_addr, 0, sizeof(info->remote_addr));
@@ -506,12 +506,11 @@ static void __socket_close_channel(struct diag_socket_info *info)
	if (info->port_type == PORT_TYPE_SERVER)
		return;

	write_lock_bh(&info->hdl->sk->sk_callback_lock);
	info->hdl->sk->sk_user_data = NULL;
	info->hdl->sk->sk_data_ready = NULL;
	info->hdl->sk->sk_error_report = NULL;
	write_unlock_bh(&info->hdl->sk->sk_callback_lock);
	mutex_lock(&info->socket_info_mutex);
	if (!info->hdl) {
		mutex_unlock(&info->socket_info_mutex);
		return;
	}
	sock_release(info->hdl);
	info->hdl = NULL;
	mutex_unlock(&info->socket_info_mutex);