All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Lynch <rusty@linux.co.intel.com>
To: mochel@osdl.org
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH][2.5.60 Trivial] Sysfs not handling show errors
Date: 12 Feb 2003 14:37:35 -0800	[thread overview]
Message-ID: <1045089456.1150.6.camel@vmhack> (raw)

Attempting to cat a sysfs file that returns an error will result in an
endless dump of garbage to the screen because the result of the specific
show operation was being saved to a size_t (unsigned) and then later
checked for a negative value.

Here is a trivial patch to fix the error.

    --rustyl

--- fs/sysfs/inode.c.orig	2003-02-12 14:38:04.000000000 -0800
+++ fs/sysfs/inode.c	2003-02-12 14:38:39.000000000 -0800
@@ -210,7 +210,7 @@
 	struct kobject * kobj = file->f_dentry->d_parent->d_fsdata;
 	struct sysfs_ops * ops = buffer->ops;
 	int ret = 0;
-	size_t count;
+	ssize_t count;
 
 	if (!buffer->page)
 		buffer->page = (char *) __get_free_page(GFP_KERNEL);




             reply	other threads:[~2003-02-12 22:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-12 22:37 Rusty Lynch [this message]
2003-02-13 15:33 ` [PATCH][2.5.60 Trivial] Sysfs not handling show errors Patrick Mochel

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=1045089456.1150.6.camel@vmhack \
    --to=rusty@linux.co.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.