mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.6.11-mm1] acpiphp_ibm: add failure handling for memory allocation
@ 2005-03-06 19:00 Panagiotis Issaris
  0 siblings, 0 replies; only message in thread
From: Panagiotis Issaris @ 2005-03-06 19:00 UTC (permalink / raw)
  To: vernux; +Cc: linux-kernel

Hi,

This patch adds failure handling for kmalloc in the ACPI PCI Hot Plug IBM
Extension driver.

Signed-off-by: <panagiotis.issaris@mech.kuleuven.ac.be>

diff -pruN linux-2.6.11-orig/drivers/pci/hotplug/acpiphp_ibm.c linux-2.6.11-pi/drivers/pci/hotplug/acpiphp_ibm.c
--- linux-2.6.11-orig/drivers/pci/hotplug/acpiphp_ibm.c	2005-03-05 03:38:06.000000000 +0100
+++ linux-2.6.11-pi/drivers/pci/hotplug/acpiphp_ibm.c	2005-03-06 19:35:06.000000000 +0100
@@ -163,6 +163,11 @@ static union apci_descriptor *ibm_slot_f
 ibm_slot_done:
 	if (ret) {
 		ret = kmalloc(sizeof(union apci_descriptor), GFP_KERNEL);
+		if (!ret) {
+			err("%s:  Memory allocation failed.\n", __FUNCTION__);
+			kfree(table);
+			return -ENOMEM;
+		}
 		memcpy(ret, des, sizeof(union apci_descriptor));
 	}
 	kfree(table);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-06 19:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-06 19:00 [PATCH 2.6.11-mm1] acpiphp_ibm: add failure handling for memory allocation Panagiotis Issaris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®