Commit 3672558c authored by Hua Zhong's avatar Hua Zhong Committed by David S. Miller

[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: default avatarHua Zhong <hzhong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 52824b6b
...@@ -490,6 +490,7 @@ static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed) ...@@ -490,6 +490,7 @@ static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
struct file *file; struct file *file;
struct socket *sock; struct socket *sock;
*err = -EBADF;
file = fget_light(fd, fput_needed); file = fget_light(fd, fput_needed);
if (file) { if (file) {
sock = sock_from_file(file, err); sock = sock_from_file(file, err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment