lkml.org 
[lkml]   [2005]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][ACPI] toshiba_acpi.c: add check for NULL pointer

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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-08-04 08:18    [W:0.032 / U:2.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site