sysfs_remove_group does create a NULL Pointer reference since kernel 2.6.16 from inside of the class_unreg_device callbacks .. this works around it

This commit is contained in:
Chrisian Richter 2006-04-11 16:04:58 +00:00
parent 28beb2274c
commit 8e7e9cdf23
4 changed files with 9 additions and 1 deletions

View File

@ -639,6 +639,7 @@ int mISDN_unregister(mISDNobject_t *obj) {
write_lock_irqsave(&mISDN_objects_lock, flags);
list_del(&obj->list);
write_unlock_irqrestore(&mISDN_objects_lock, flags);
if (core_debug & DEBUG_CORE_FUNC)
printk(KERN_DEBUG "mISDN_unregister: mISDN_objectlist(%p<-%p->%p)\n",
mISDN_objectlist.prev, &mISDN_objectlist, mISDN_objectlist.next);

View File

@ -48,7 +48,10 @@ static void release_mISDN_inst(struct class_device *dev)
if (inst->obj)
sysfs_remove_link(&dev->kobj, "obj");
#if 0
sysfs_remove_group(&inst->class_dev.kobj, &pid_group);
#endif
printk(KERN_INFO "release instance class dev %s\n", dev->class_id);
}

View File

@ -80,8 +80,11 @@ static void release_mISDN_obj(struct class_device *dev)
if (obj->owner->mkobj)
#endif
sysfs_remove_link(&dev->kobj, "module");
#if 0
sysfs_remove_group(&obj->class_dev.kobj, &BPROTO_group);
sysfs_remove_group(&obj->class_dev.kobj, &DPROTO_group);
#endif
}
static struct class obj_dev_class = {

View File

@ -177,9 +177,10 @@ static void release_mISDN_stack(struct class_device *dev)
{
mISDNstack_t *st = to_mISDNstack(dev);
char name[12];
#if 0
sysfs_remove_group(&st->class_dev.kobj, &pid_group);
sysfs_remove_group(&st->class_dev.kobj, &new_pid_group);
#endif
printk(KERN_INFO "release stack class dev %s\n", dev->class_id);
if (st->parent) {
sysfs_remove_link(&dev->kobj, "parent");