From: Hua Zhong Date: Wed, 19 Apr 2006 22:25:02 +0000 (-0700) Subject: [NET]: sockfd_lookup_light() returns random error for -EBADFD X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3672558c6180ca28a7aa46765702467a37e58fc5;p=deliverable%2Flinux.git [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 Signed-off-by: David S. Miller --- 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) struct file *file; struct socket *sock; + *err = -EBADF; file = fget_light(fd, fput_needed); if (file) { sock = sock_from_file(file, err);