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 Signed-off-by: Greg Kroah-Hartman 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);