The patch titled Driver core: Fix cleanup when failing device_add(). has been removed from the -mm tree. Its filename was driver-core-fix-cleanup-when-failing-device_add.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: Driver core: Fix cleanup when failing device_add(). From: Cornelia Huck <cornelia.huck@xxxxxxxxxx> - Don't call cleanup_device_parent() if we didn't call setup_parent(). - dev->kobj.parent may be NULL when cleanup_device_parent() is called, so we need to handle glue_dir == NULL in cleanup_glue_dir(). Signed-off-by: Cornelia Huck <cornelia.huck@xxxxxxxxxx> Cc: Greg KH <greg@xxxxxxxxx> Cc: Kay Sievers <kay.sievers@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/base/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN drivers/base/core.c~driver-core-fix-cleanup-when-failing-device_add drivers/base/core.c --- a/drivers/base/core.c~driver-core-fix-cleanup-when-failing-device_add +++ a/drivers/base/core.c @@ -627,7 +627,8 @@ static struct kobject *get_device_parent static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir) { /* see if we live in a "glue" directory */ - if (!dev->class || glue_dir->kset != &dev->class->class_dirs) + if (!glue_dir || !dev->class || + glue_dir->kset != &dev->class->class_dirs) return; kobject_put(glue_dir); @@ -779,7 +780,7 @@ int device_add(struct device *dev) dev = get_device(dev); if (!dev || !strlen(dev->bus_id)) { error = -EINVAL; - goto Error; + goto Done; } pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__); _ Patches currently in -mm which might be from cornelia.huck@xxxxxxxxxx are -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html