From: Dmitriy Monakhov Date: Sun, 11 Mar 2007 12:36:19 +0000 (+0300) Subject: driver core: fix device_add error path X-Git-Tag: v2.6.22-rc1~1119^2~45 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00ed8e3dda47f8421b11da17e353d7db8c878121;p=linux-2.6 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/core.c b/drivers/base/core.c index d7fcf823a4..db3a151be4 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -677,15 +677,6 @@ int device_add(struct device *dev) #endif 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: device_remove_file(dev, &dev->uevent_attr);