Skip to contentSkip to conversation

acpi: Toshiba failure handling

PATCH Applied [email protected] 2 participants 2 messages Mar 30, 2005 – Mar 31, 2005 1 message not in the archive ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 acpi: Toshiba failure handling

From: "Panagiotis Issaris" <panagiotis.issaris-hfxpx0nnwYVX2QMWbMbClIble9XqW/[email protected]>

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

---

 25-akpm/drivers/acpi/toshiba_acpi.c |    3 +++
 1 files changed, 3 insertions(+)
drivers/acpi/toshiba_acpi.c renamed from drivers/acpi/toshiba_acpi.c~acpi-toshiba-failure-handling +3 -0
diff -puN drivers/acpi/toshiba_acpi.c~acpi-toshiba-failure-handling 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;
 	}

_

-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30

Applied
#2 lore raw
In reply to a message not in the archive

Applied.

thanks,
-Len

Quoted 28 lines · On Wed, 2005-03-30 at 16:16, [email protected] wrote:

From: "Panagiotis Issaris" <panagiotis.issaris-hfxpx0nnwYVX2QMWbMbClIble9XqW/[email protected]>

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

---

 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 Wed Mar 30 13:16:02 2005
+++ 25-akpm/drivers/acpi/toshiba_acpi.c Wed Mar 30 13:16:02 2005

drivers/acpi/toshiba_acpi.c renamed from drivers/acpi/toshiba_acpi.c~acpi-toshiba-failure-handling +3 -0
@@ -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;
        }
Quoted 3 lines

_

-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30