
From: "Panagiotis Issaris" <panagiotis.issaris@mech.kuleuven.ac.be>

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

Signed-off-by: Panagiotis Issaris <takis@gna.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/acpi/toshiba_acpi.c |    3 +++
 1 files changed, 3 insertions(+)

diff -puN drivers/acpi/toshiba_acpi.c~acpi-toshiba-failure-handling drivers/acpi/toshiba_acpi.c
--- 25/drivers/acpi/toshiba_acpi.c~acpi-toshiba-failure-handling	2005-03-04 22:01:54.000000000 -0800
+++ 25-akpm/drivers/acpi/toshiba_acpi.c	2005-03-04 22:01:54.000000000 -0800
@@ -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;
 	}
_
