From: Jeff Garzik <jgarzik@pobox.com>
To: linguist@masterlinkcorp.com
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@suse.de>,
Andrew Morton <akpm@osdl.org>
Subject: [PATCH] fix tiocgdev 32/64bit emul
Date: Sun, 21 Mar 2004 11:45:12 -0500 [thread overview]
Message-ID: <405DC698.4040802@pobox.com> (raw)
In-Reply-To: <20040321062435.GA27226@goblin.masterlinkcorp.com>
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
linguist@masterlinkcorp.com wrote:
> This is just a random observation, I don't know this piece of code
> or the kernel in general, but instinct tells me that where is says
> "if (!fd) return -EBADF", it should say "if (!file) return -EBADF".
> Just a heads up.
>
> Regards,
> Rich
>
> static int tiocgdev(unsigned fd, unsigned cmd, unsigned int *ptr)
> {
>
> struct file *file = fget(fd);
> struct tty_struct *real_tty;
>
> if (!fd)
> return -EBADF;
Yup, looks like a real bug to me... good catch.
Untested but obvious patch attached.
Jeff
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 370 bytes --]
===== arch/x86_64/ia32/ia32_ioctl.c 1.38 vs edited =====
--- 1.38/arch/x86_64/ia32/ia32_ioctl.c Wed Feb 25 11:06:01 2004
+++ edited/arch/x86_64/ia32/ia32_ioctl.c Sun Mar 21 11:43:56 2004
@@ -27,7 +27,7 @@
struct file *file = fget(fd);
struct tty_struct *real_tty;
- if (!fd)
+ if (!file)
return -EBADF;
if (file->f_op->ioctl != tty_ioctl)
return -EINVAL;
next prev parent reply other threads:[~2004-03-21 16:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-21 6:24 linguist
2004-03-21 16:45 ` Jeff Garzik [this message]
2004-03-21 16:57 ` [PATCH] fix tiocgdev 32/64bit emul Christoph Hellwig
2004-03-21 18:50 ` Carl-Daniel Hailfinger
2004-03-21 18:55 ` Christoph Hellwig
2004-03-21 19:57 ` Carl-Daniel Hailfinger
2004-03-21 20:02 ` Christoph Hellwig
2004-03-21 20:17 ` Carl-Daniel Hailfinger
2004-03-21 20:26 ` Christoph Hellwig
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=405DC698.4040802@pobox.com \
--to=jgarzik@pobox.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=linguist@masterlinkcorp.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®