lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061009091201.GA6448@localhost>
Date:	Mon, 9 Oct 2006 18:12:01 +0900
From:	akinobu.mita@...il.com (Akinobu Mita)
To:	linux-kernel@...r.kernel.org, linux-usb-devel@...ts.sourceforge.net
Cc:	Greg Kroah-Hartman <gregkh@...e.de>
Subject: [PATCH] driver core: handle bus_attach_device() failure

This patch handles bus_attach_device() failure in device_add().

Cc: Greg Kroah-Hartman <gregkh@...e.de>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>

 drivers/base/core.c |   22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

Index: 2.6-mm/drivers/base/core.c
===================================================================
--- 2.6-mm.orig/drivers/base/core.c	2006-10-03 22:58:40.000000000 +0900
+++ 2.6-mm/drivers/base/core.c	2006-10-09 16:57:52.000000000 +0900
@@ -530,7 +530,9 @@ int device_add(struct device *dev)
 	if ((error = bus_add_device(dev)))
 		goto BusError;
 	kobject_uevent(&dev->kobj, KOBJ_ADD);
-	bus_attach_device(dev);
+	if ((error = bus_attach_device(dev)))
+		goto BusAttachError;
+
 	if (parent)
 		klist_add_tail(&dev->knode_parent, &parent->klist_children);
 
@@ -548,6 +550,8 @@ int device_add(struct device *dev)
  Done:
 	put_device(dev);
 	return error;
+ BusAttachError:
+	bus_remove_device(dev);
  BusError:
 	device_pm_remove(dev);
  PMError:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ