mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Hmamouche, Youssef" <youssef@ece.utexas.edu>
To: linux-kernel@vger.kernel.org
Cc: toshiba_acpi@memebeam.org, youssef@ece.utexas.edu
Subject: [PATCH][ACPI] toshiba_acpi.c: add check for NULL pointer
Date: Thu, 4 Aug 2005 01:08:09 -0500 (CDT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0508040048190.14176@linux08.ece.utexas.edu> (raw)


This patch adds a check for NULL return from kmalloc.

Signed-off-by: Youssef Hmamouche <hyoussef@gmail.com>



--- a/drivers/acpi/toshiba_acpi.c       2005-07-15 14:18:57.000000000 -0700
+++ b/drivers/acpi/toshiba_acpi.c       2005-08-03 21:35:12.000000000 -0700
@@ -263,6 +263,9 @@
          * destination so that sscanf can be used on it safely.
          */
         tmp_buffer = kmalloc(count + 1, GFP_KERNEL);
+       if(tmp_buffer == NULL) {
+               return -ENOMEM;
+       }
         if (copy_from_user(tmp_buffer, buffer, count)) {
                 result = -EFAULT;
         }

             reply	other threads:[~2005-08-04  6:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-04  6:08 Hmamouche, Youssef [this message]
2005-08-04  6:39 ` Pekka Enberg

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=Pine.LNX.4.61.0508040048190.14176@linux08.ece.utexas.edu \
    --to=youssef@ece.utexas.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=toshiba_acpi@memebeam.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®