public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yury Umanets <torque@ukrpost.net>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.6.6 memory allocation checks in eth1394_update()
Date: Sun, 06 Jun 2004 19:10:51 +0300	[thread overview]
Message-ID: <1086538251.2793.74.camel@firefly> (raw)

Adds memory allocation checks in eth1394_update().

 ./linux-2.6.6-modified/drivers/ieee1394/eth1394.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

Signed-off-by: Yury Umanets <torque@ukrpost.net>

diff -rupN ./linux-2.6.6/drivers/ieee1394/eth1394.c
./linux-2.6.6-modified/drivers/ieee1394/eth1394.c
--- ./linux-2.6.6/drivers/ieee1394/eth1394.c	Mon May 10 05:32:52 2004
+++ ./linux-2.6.6-modified/drivers/ieee1394/eth1394.c	Wed Jun  2
14:19:59 2004
@@ -431,9 +431,12 @@ static int eth1394_update(struct unit_di
 		if (!node)
 			return -ENOMEM;
 
-
 		node_info = kmalloc(sizeof(struct eth1394_node_info),
 				    in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
+		if (!node_info) {
+			kfree(node);
+			return -ENOMEM;
+                }
 
 		spin_lock_init(&node_info->pdg.lock);
 		INIT_LIST_HEAD(&node_info->pdg.list);

-- 
umka


                 reply	other threads:[~2004-06-06 16:10 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=1086538251.2793.74.camel@firefly \
    --to=torque@ukrpost.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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