* [PATCH] sockfd_lookup_light() returns random error for -EBADFD
@ 2006-04-19 19:01 Hua Zhong
2006-04-19 22:25 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Hua Zhong @ 2006-04-19 19:01 UTC (permalink / raw)
To: Linux-kernel, netdev, torvalds, davem, akpm
This applies to 2.6.17-rc2.
There is a missing initialization of err in sockfd_lookup_light() that could return random error for an invalid file handle.
Signed-off-by: Hua Zhong <hzhong@gmail.com>
diff --git a/net/socket.c b/net/socket.c
index 23898f4..0ce12df 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -490,6 +490,7 @@ static struct socket *sockfd_lookup_ligh
struct file *file;
struct socket *sock;
+ *err = -EBADF;
file = fget_light(fd, fput_needed);
if (file) {
sock = sock_from_file(file, err);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-19 22:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-19 19:01 [PATCH] sockfd_lookup_light() returns random error for -EBADFD Hua Zhong
2006-04-19 22:25 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).