netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hua Zhong <hzhong@gmail.com>
To: Linux-kernel <linux-kernel@vger.kernel.org>,
	netdev@vger.kernel.org, torvalds@osdl.org, davem@davemloft.net,
	akpm@osdl.org
Subject: [PATCH] sockfd_lookup_light() returns random error for -EBADFD
Date: Wed, 19 Apr 2006 12:01:06 -0700	[thread overview]
Message-ID: <444688F2.5060909@gmail.com> (raw)

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);

             reply	other threads:[~2006-04-19 19:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-19 19:01 Hua Zhong [this message]
2006-04-19 22:25 ` [PATCH] sockfd_lookup_light() returns random error for -EBADFD David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=444688F2.5060909@gmail.com \
    --to=hzhong@gmail.com \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).