aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHua Zhong <hzhong@gmail.com>2006-04-19 18:25:02 -0400
committerDavid S. Miller <davem@davemloft.net>2006-04-19 18:25:02 -0400
commit3672558c6180ca28a7aa46765702467a37e58fc5 (patch)
tree1529de37f6139fff32de963423178c42ec6c1629
parent52824b6b5fa0533e2b2adc9df396d0e9ff6fb02a (diff)
[NET]: sockfd_lookup_light() returns random error for -EBADFD
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> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/socket.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c
index 23898f45f713..0ce12dfc7a71 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -490,6 +490,7 @@ static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
490 struct file *file; 490 struct file *file;
491 struct socket *sock; 491 struct socket *sock;
492 492
493 *err = -EBADF;
493 file = fget_light(fd, fput_needed); 494 file = fget_light(fd, fput_needed);
494 if (file) { 495 if (file) {
495 sock = sock_from_file(file, err); 496 sock = sock_from_file(file, err);