mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 7/7] Char: isicom, check kmalloc retval
Date: Thu, 19 Oct 2006 22:26:59 +0200 (CEST)	[thread overview]
Message-ID: <2618228894234632957@wsc.cz> (raw)

isicom, check kmalloc retval

Value returned from kamlloc may be NULL, we should check if ENOMEM occured.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit a026bdacd388dd774b6e6bd50dcb12adb10115f1
tree f729251fccf62c68dfc4e126574f2e1ee898a35a
parent b298d99f4a779fb54b0035f0f870d5247b13b269
author Jiri Slaby <jirislaby@gmail.com> Thu, 19 Oct 2006 19:47:29 +0200
committer Jiri Slaby <jirislaby@gmail.com> Thu, 19 Oct 2006 19:47:29 +0200

 drivers/char/isicom.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 2f5be09..a3d59a6 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -1708,6 +1708,11 @@ static int __devinit load_firmware(struc
 		}
 
 		data = kmalloc(word_count * 2, GFP_KERNEL);
+		if (data == NULL) {
+			dev_err(&pdev->dev, "Card%d, firmware upload "
+				"failed, not enough memory\n", index + 1);
+			goto errrelfw;
+		}
 		inw(base);
 		insw(base, data, word_count);
 		InterruptTheCard(base);

             reply	other threads:[~2006-10-19 20:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-19 20:26 Jiri Slaby [this message]
2006-10-19 21:50 ` Alan Cox

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=2618228894234632957@wsc.cz \
    --to=jirislaby@gmail.com \
    --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

all inboxes | Powered by JetHome®