All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brandon Niemczyk <brandon@snprogramming.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] toshiba_acpi check kmalloc return value
Date: Mon, 11 Jul 2005 01:20:44 +0000	[thread overview]
Message-ID: <1121044844.3554.25.camel@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 574 bytes --]

Signed-off-by: Brandon Niemczyk <brandon@snprogramming.com>

--- linux/drivers/acpi/toshiba_acpi.c.orig	2005-07-10 20:40:47.000000000 -0400
+++ linux/drivers/acpi/toshiba_acpi.c	2005-07-10 20:42:33.000000000 -0400
@@ -263,7 +263,10 @@ dispatch_write(struct file* file, const 
 	 * destination so that sscanf can be used on it safely.
 	 */
 	tmp_buffer = kmalloc(count + 1, GFP_KERNEL);
-	if (copy_from_user(tmp_buffer, buffer, count)) {
+
+	if(!tmp_buffer) {
+		return -ENOMEM;
+	} else if (copy_from_user(tmp_buffer, buffer, count)) {
 		result = -EFAULT;
 	}
 	else {




[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

             reply	other threads:[~2005-07-11  1:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-11  1:20 Brandon Niemczyk [this message]
2005-07-11  2:32 ` [KJ] [PATCH] toshiba_acpi check kmalloc return value randy_dunlap
2005-07-11  3:07 ` Brandon Niemczyk
2005-07-11  9:53 ` walter harms
2005-07-11 11:24 ` Brandon Niemczyk
2005-07-11 13:01 ` Domen Puncer
2005-07-11 15:55 ` walter harms
2005-07-11 17:08 ` Domen Puncer

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=1121044844.3554.25.camel@localhost \
    --to=brandon@snprogramming.com \
    --cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.