]> err.no Git - linux-2.6/commitdiff
[ACPI] check for kmalloc failure in toshiba_acpi.c
authorPanagiotis Issaris <takis@gna.org>
Thu, 31 Mar 2005 03:15:36 +0000 (22:15 -0500)
committerLen Brown <len.brown@intel.com>
Tue, 12 Jul 2005 03:57:35 +0000 (23:57 -0400)
Signed-off-by: Panagiotis Issaris <takis@gna.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/toshiba_acpi.c

index bed8e53a5ee859006f85a670d1354c27139be39e..73b1d8aeae9d33ca1a69b82f6483d4cf39049a0f 100644 (file)
@@ -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;
        }