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>
tirimbino
Sharath Chandra Vurukala 4 years ago committed by Gerrit - the friendly Code Review server
parent 861c7b1f24
commit 033f2e4393
  1. 6
      net/socket.c

@ -1505,9 +1505,10 @@ SYSCALL_DEFINE3(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;
}
@ -1534,9 +1535,10 @@ SYSCALL_DEFINE2(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;
}

Loading…
Cancel
Save