Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00ed8e3d authored by Dmitriy Monakhov's avatar Dmitriy Monakhov Committed by Greg Kroah-Hartman
Browse files

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: default avatarMonakhov Dmitriy <dmonakhov@openvz.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c58b8e4a
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -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);