+ pcie-check-and-return-bus_register-errors.patch added to -mm tree

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

 



The patch titled

     PCIE: check and return bus_register errors

has been added to the -mm tree.  Its filename is

     pcie-check-and-return-bus_register-errors.patch

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

------------------------------------------------------
Subject: PCIE: check and return bus_register errors
From: Randy Dunlap <rdunlap@xxxxxxxxxxxx>

Have pcie_port_bus_register() notice and return errors.  Mark it
__must_check so that its caller(s) must check its return value.

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/pci/pcie/portdrv.h      |    2 +-
 drivers/pci/pcie/portdrv_core.c |    5 +++--
 drivers/pci/pcie/portdrv_pci.c  |    9 +++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff -puN drivers/pci/pcie/portdrv_core.c~pcie-check-and-return-bus_register-errors drivers/pci/pcie/portdrv_core.c
--- a/drivers/pci/pcie/portdrv_core.c~pcie-check-and-return-bus_register-errors
+++ a/drivers/pci/pcie/portdrv_core.c
@@ -6,6 +6,7 @@
  * Copyright (C) Tom Long Nguyen (tom.l.nguyen@xxxxxxxxx)
  */
 
+#include <linux/compiler.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
@@ -402,9 +403,9 @@ void pcie_port_device_remove(struct pci_
 		pci_disable_msi(dev);
 }
 
-void pcie_port_bus_register(void)
+int __must_check pcie_port_bus_register(void)
 {
-	bus_register(&pcie_port_bus_type);
+	return bus_register(&pcie_port_bus_type);
 }
 
 void pcie_port_bus_unregister(void)
diff -puN drivers/pci/pcie/portdrv.h~pcie-check-and-return-bus_register-errors drivers/pci/pcie/portdrv.h
--- a/drivers/pci/pcie/portdrv.h~pcie-check-and-return-bus_register-errors
+++ a/drivers/pci/pcie/portdrv.h
@@ -39,7 +39,7 @@ extern int pcie_port_device_suspend(stru
 extern int pcie_port_device_resume(struct pci_dev *dev);
 #endif
 extern void pcie_port_device_remove(struct pci_dev *dev);
-extern void pcie_port_bus_register(void);
+extern int pcie_port_bus_register(void);
 extern void pcie_port_bus_unregister(void);
 
 #endif /* _PORTDRV_H_ */
diff -puN drivers/pci/pcie/portdrv_pci.c~pcie-check-and-return-bus_register-errors drivers/pci/pcie/portdrv_pci.c
--- a/drivers/pci/pcie/portdrv_pci.c~pcie-check-and-return-bus_register-errors
+++ a/drivers/pci/pcie/portdrv_pci.c
@@ -127,12 +127,17 @@ static struct pci_driver pcie_portdrv = 
 
 static int __init pcie_portdrv_init(void)
 {
-	int retval = 0;
+	int retval;
 
-	pcie_port_bus_register();
+	retval = pcie_port_bus_register();
+	if (retval) {
+		printk(KERN_WARNING "PCIE: bus_register error: %d\n", retval);
+		goto out;
+	}
 	retval = pci_register_driver(&pcie_portdrv);
 	if (retval)
 		pcie_port_bus_unregister();
+ out:
 	return retval;
 }
 
_

Patches currently in -mm which might be from rdunlap@xxxxxxxxxxxx are

acpi-bus-add-missing-newline.patch
pcie-check-and-return-bus_register-errors.patch
pcie-cleanup-on-probe-error.patch
aic7-cleanup-module_parm_desc-strings.patch
dc395x-fix-printk-format-warning.patch
areca-raid-linux-scsi-driver.patch
consistently-use-max_errno-in-__syscall_return.patch
consistently-use-max_errno-in-__syscall_return-fix.patch
eisa-bus-modalias-attributes-support-1.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