lkml.org 
[lkml]   [2008]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] driver core: don't pass cls->name as format string in sysdev_class_register()
Date
From: Ming Lei <tom.leiming@gmail.com>

If cls->name contains substring which can be interpreted as
format,maybe it causes oops, so fix it.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/base/sys.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index c98c31e..736ecf7 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -137,7 +137,7 @@ int sysdev_class_register(struct sysdev_class * cls)
cls->kset.kobj.parent = &system_kset->kobj;
cls->kset.kobj.ktype = &ktype_sysdev_class;
cls->kset.kobj.kset = system_kset;
- kobject_set_name(&cls->kset.kobj, cls->name);
+ kobject_set_name(&cls->kset.kobj, "%s", cls->name);
return kset_register(&cls->kset);
}

--
1.6.0


\
 
 \ /
  Last update: 2008-12-13 11:41    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site