[PATCH] PCI Hotplug: only call ibmphp_remove_resource() if argument is not NULL

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

 



ChangeSet 1.2181.16.10, 2005/03/17 13:54:51-08:00, [email protected]

[PATCH] PCI Hotplug: only call ibmphp_remove_resource() if argument is not NULL

If we call ibmphp_remove_resource() with a NULL argument it will write
a warning. We can avoid this here because we already look if the argument
will be NULL before (and we ignore the return code anyway).

Signed-off-by: Rolf Eike Beer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>


 drivers/pci/hotplug/ibmphp_pci.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)


diff -Nru a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
--- a/drivers/pci/hotplug/ibmphp_pci.c	2005-04-01 15:36:56 -08:00
+++ b/drivers/pci/hotplug/ibmphp_pci.c	2005-04-01 15:36:56 -08:00
@@ -1317,10 +1317,11 @@
 					err ("cannot find corresponding PFMEM resource to remove\n");
 					return -EIO;
 				}
-				if (pfmem)
+				if (pfmem) {
 					debug ("pfmem->start = %x\n", pfmem->start);
 
-				ibmphp_remove_resource (pfmem);
+					ibmphp_remove_resource(pfmem);
+				}
 			} else {
 				/* regular memory */
 				debug ("start address of mem is %x\n", start_address);
@@ -1328,10 +1329,11 @@
 					err ("cannot find corresponding MEM resource to remove\n");
 					return -EIO;
 				}
-				if (mem)
+				if (mem) {
 					debug ("mem->start = %x\n", mem->start);
 
-				ibmphp_remove_resource (mem);
+					ibmphp_remove_resource(mem);
+				}
 			}
 			if (tmp_address & PCI_BASE_ADDRESS_MEM_TYPE_64) {
 				/* takes up another dword */
@@ -1427,20 +1429,22 @@
 					err ("cannot find corresponding PFMEM resource to remove\n");
 					return -EINVAL;
 				}
-				if (pfmem)
+				if (pfmem) {
 					debug ("pfmem->start = %x\n", pfmem->start);
 
-				ibmphp_remove_resource (pfmem);
+					ibmphp_remove_resource(pfmem);
+				}
 			} else {
 				/* regular memory */
 				if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) {
 					err ("cannot find corresponding MEM resource to remove\n");
 					return -EINVAL;
 				}
-				if (mem)
+				if (mem) {
 					debug ("mem->start = %x\n", mem->start);
 
-				ibmphp_remove_resource (mem);
+					ibmphp_remove_resource(mem);
+				}
 			}
 			if (tmp_address & PCI_BASE_ADDRESS_MEM_TYPE_64) {
 				/* takes up another dword */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux