lkml.org 
[lkml]   [2004]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] Driver Core patches for 2.6.10-rc1
Date
From
ChangeSet 1.2018, 2004/10/22 13:55:29-07:00, shemminger@osdl.org

[PATCH] cdev: protect against buggy drivers

Here is a better fix (thanks Greg) that allows long names for character
device objects.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


fs/char_dev.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/fs/char_dev.c b/fs/char_dev.c
--- a/fs/char_dev.c 2004-10-22 16:00:27 -07:00
+++ b/fs/char_dev.c 2004-10-22 16:00:27 -07:00
@@ -207,8 +207,8 @@

cdev->owner = fops->owner;
cdev->ops = fops;
- strcpy(cdev->kobj.name, name);
- for (s = strchr(cdev->kobj.name, '/'); s; s = strchr(s, '/'))
+ kobject_set_name(&cdev->kobj, "%s", name);
+ for (s = strchr(kobject_name(&cdev->kobj),'/'); s; s = strchr(s, '/'))
*s = '!';

err = cdev_add(cdev, MKDEV(cd->major, 0), 256);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.046 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site