From: Panagiotis Issaris Date: Thu, 31 Mar 2005 03:15:36 +0000 (-0500) Subject: [ACPI] check for kmalloc failure in toshiba_acpi.c X-Git-Tag: v2.6.13-rc3~10^2^2~17 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f4224153098c1103db592b28f304beeb9c02481b;p=linux-2.6-omap-h63xx.git [ACPI] check for kmalloc failure in toshiba_acpi.c Signed-off-by: Panagiotis Issaris Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index bed8e53a5ee..73b1d8aeae9 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c @@ -263,6 +263,9 @@ dispatch_write(struct file* file, const char __user * buffer, * 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; }