On Sun, Mar 09, 2008 at 03:37:16AM +0530, Balaji Rao wrote:Ugh, that's horrible. And people wonder why I hate the sysdev code :) Does it also mean that when we do cleanup sysdev devices, we are freeing a name that might not have been dynamically allocated? If so, we need to fix that as well. A simple 'strdup' of the class name in sysdev_class_register() should fix all of this, right? Yes, that would be great to fix up, but probably unlikly so late in the release cycle. How about the patch below, does it work for you? (build tested only) thanks, greg k-h --- drivers/base/sys.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -130,13 +130,16 @@ static struct kset *system_kset; int sysdev_class_register(struct sysdev_class * cls) { + char *name; + pr_debug("Registering sysdev class '%s'\n", kobject_name(&cls->kset.kobj)); INIT_LIST_HEAD(&cls->drivers); 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); + name = kstrdup(cls->name, GFP_KERNEL); + kobject_set_name(&cls->kset.kobj, name); return kset_register(&cls->kset); } --
| Greg KH | Og dreams of kernels |
| Jens Axboe | [PATCH 31/33] Fusion: sg chaining support |
| Arnd Bergmann | Re: finding your own dead "CONFIG_" variables |
| Mark Brown | [PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset |
| Tony Breeds | [LGUEST] Look in object dir for .config |
git: | |
| Brian Downing | Re: Git in a Nutshell guide |
| John Benes | Re: master has some toys |
| Matthias Lederhofer | [PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree |
| Alexander Sulfrian | [RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set |
| Junio C Hamano | Re: Rss produced by git is not valid xml? |
| Linux Kernel Mailing List | iSeries: fix section mismatch in iseries_veth |
| Linux Kernel Mailing List | ixbge: remove TX lock and redo TX accounting. |
| Linux Kernel Mailing List | ixgbe: fix several counter register errata |
| Linux Kernel Mailing List | b43: fix build with CONFIG_SSB_PCIHOST=n |
| Linux Kernel Mailing List | 9p: block-based virtio client |
