+ driver-core-fixes-device_register-retval-check-in.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     driver core fixes: device_register() retval check in platform.c
has been added to the -mm tree.  Its filename is
     driver-core-fixes-device_register-retval-check-in.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: driver core fixes: device_register() retval check in platform.c
From: Cornelia Huck <cornelia.huck@xxxxxxxxxx>

Check the return value of device_register() in platform_bus_init().

Signed-off-by: Cornelia Huck <cornelia.huck@xxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/base/platform.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff -puN drivers/base/platform.c~driver-core-fixes-device_register-retval-check-in drivers/base/platform.c
--- a/drivers/base/platform.c~driver-core-fixes-device_register-retval-check-in
+++ a/drivers/base/platform.c
@@ -563,8 +563,15 @@ EXPORT_SYMBOL_GPL(platform_bus_type);
 
 int __init platform_bus_init(void)
 {
-	device_register(&platform_bus);
-	return bus_register(&platform_bus_type);
+	int error;
+
+	error = device_register(&platform_bus);
+	if (error)
+		return error;
+	error =  bus_register(&platform_bus_type);
+	if (error)
+		device_unregister(&platform_bus);
+	return error;
 }
 
 #ifndef ARCH_HAS_DMA_GET_REQUIRED_MASK
_

Patches currently in -mm which might be from cornelia.huck@xxxxxxxxxx are

driver-core-fixes-make_class_name-retval-checks.patch
driver-core-fixes-sysfs_create_link-retval-checks-in.patch
driver-core-fixes-device_register-retval-check-in.patch
driver-core-dont-stop-probing-on-probe-errors.patch
driver-core-change-function-call-order-in.patch
driver-core-per-subsystem-multithreaded-probing.patch
driver-core-dont-fail-attaching-the-device-if-it.patch
cpu-topology-consider-sysfs_create_group-return-value.patch
git-s390.patch
tty-switch-to-ktermios-sclp-fix.patch

-
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

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux