net:sockev: hold file reference till the sock event is sent

Hold file reference till the sock event is sent.

Change-Id: I14d581f210c86e5771bec22a9aca7c78630e9ac1
Signed-off-by: Sharath Chandra Vurukala <sharathv@codeaurora.org>
This commit is contained in:
Sharath Chandra Vurukala 2020-09-04 20:20:25 +05:30
parent bed17f6d1d
commit 6323bbf9f2

View file

@ -1496,9 +1496,10 @@ int __sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen)
(struct sockaddr *)
&address, addrlen);
}
fput_light(sock->file, fput_needed);
if (!err)
sockev_notify(SOCKEV_BIND, sock);
fput_light(sock->file, fput_needed);
}
return err;
}
@ -1530,9 +1531,10 @@ int __sys_listen(int fd, int backlog)
if (!err)
err = sock->ops->listen(sock, backlog);
fput_light(sock->file, fput_needed);
if (!err)
sockev_notify(SOCKEV_LISTEN, sock);
fput_light(sock->file, fput_needed);
}
return err;
}