driver core: fix device_add error path
- At the moment we jump here device was't added to dev->class->devices list yet. Signed-off-by: Monakhov Dmitriy <dmonakhov@openvz.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c58b8e4a25
commit
00ed8e3dda
@@ -677,15 +677,6 @@ int device_add(struct device *dev)
|
|||||||
#endif
|
#endif
|
||||||
sysfs_remove_link(&dev->kobj, "device");
|
sysfs_remove_link(&dev->kobj, "device");
|
||||||
}
|
}
|
||||||
|
|
||||||
down(&dev->class->sem);
|
|
||||||
/* notify any interfaces that the device is now gone */
|
|
||||||
list_for_each_entry(class_intf, &dev->class->interfaces, node)
|
|
||||||
if (class_intf->remove_dev)
|
|
||||||
class_intf->remove_dev(dev, class_intf);
|
|
||||||
/* remove the device from the class list */
|
|
||||||
list_del_init(&dev->node);
|
|
||||||
up(&dev->class->sem);
|
|
||||||
}
|
}
|
||||||
ueventattrError:
|
ueventattrError:
|
||||||
device_remove_file(dev, &dev->uevent_attr);
|
device_remove_file(dev, &dev->uevent_attr);
|
||||||
|
Reference in New Issue
Block a user