* [PATCH][2.5.60 Trivial] Sysfs not handling show errors
@ 2003-02-12 22:37 Rusty Lynch
2003-02-13 15:33 ` Patrick Mochel
0 siblings, 1 reply; 2+ messages in thread
From: Rusty Lynch @ 2003-02-12 22:37 UTC (permalink / raw)
To: mochel; +Cc: lkml
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-02-13 15:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-12 22:37 [PATCH][2.5.60 Trivial] Sysfs not handling show errors Rusty Lynch
2003-02-13 15:33 ` Patrick Mochel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox