mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Panagiotis Issaris" <panagiotis.issaris@mech.kuleuven.ac.be>
To: vernux@us.ibm.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.11-mm1] acpiphp_ibm: add failure handling for memory allocation
Date: Sun, 6 Mar 2005 20:00:46 +0100	[thread overview]
Message-ID: <20050306190046.GA6992@mech.kuleuven.ac.be> (raw)

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);

                 reply	other threads:[~2005-03-06 19:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050306190046.GA6992@mech.kuleuven.ac.be \
    --to=panagiotis.issaris@mech.kuleuven.ac.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vernux@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®