tree fa95a72d6554d68f412c58e3ff59a663d275186a
parent 83ea7445221651dc43cf8d22f81089e0cbccf22b
author Panagiotis Issaris <[EMAIL PROTECTED]> Thu, 31 Mar 2005 08:15:36 -0500
committer Len Brown <[EMAIL PROTECTED]> Tue, 12 Jul 2005 07:57:35 -0400

[ACPI] check for kmalloc failure in toshiba_acpi.c

Signed-off-by: Panagiotis Issaris <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Len Brown <[EMAIL PROTECTED]>

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

diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -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;
        }
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to