All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] toshiba_acpi check kmalloc return value
@ 2005-07-11  1:20 Brandon Niemczyk
  2005-07-11  2:32 ` randy_dunlap
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Brandon Niemczyk @ 2005-07-11  1:20 UTC (permalink / raw)
  To: kernel-janitors

[-- 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-07-11 17:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-11  1:20 [KJ] [PATCH] toshiba_acpi check kmalloc return value Brandon Niemczyk
2005-07-11  2:32 ` 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

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.