lkml.org 
[lkml]   [2005]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] Toshiba ACPI failure handling
Hi,

Adds the missing failure handling for a kmalloc in the Toshiba
ACPI driver.

Signed-off-by: Panagiotis Issaris <takis@gna.org>

diff -pruN linux-2.6.11-orig/drivers/acpi/toshiba_acpi.c linux-2.6.11-pi/drivers/acpi/toshiba_acpi.c
--- linux-2.6.11-orig/drivers/acpi/toshiba_acpi.c 2005-03-05 01:04:40.000000000 +0100
+++ linux-2.6.11-pi/drivers/acpi/toshiba_acpi.c 2005-03-05 01:03:13.000000000 +0100
@@ -263,6 +263,9 @@ dispatch_write(struct file* file, const
* destination so that sscanf can be used on it safely.
*/
tmp_buffer = kmalloc(count + 1, GFP_KERNEL);
+ if(!tmp_buffer)
+ return -ENOMEM;
+
if (copy_from_user(tmp_buffer, buffer, count)) {
result = -EFAULT;
}
--
K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group
http://people.mech.kuleuven.ac.be/~pissaris/
-
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-03-22 14:10    [W:0.031 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site