patch-2.4.2 linux/drivers/acpi/interpreter/amstorob.c
Next file: linux/drivers/acpi/interpreter/amutils.c
Previous file: linux/drivers/acpi/interpreter/amstore.c
Back to the patch index
Back to the overall index
- Lines: 43
- Date:
Fri Feb 9 11:45:58 2001
- Orig file:
v2.4.1/linux/drivers/acpi/interpreter/amstorob.c
- Orig date:
Sat Feb 3 19:51:25 2001
diff -u --recursive --new-file v2.4.1/linux/drivers/acpi/interpreter/amstorob.c linux/drivers/acpi/interpreter/amstorob.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: amstorob - AML Interpreter object store support, store to object
- * $Revision: 22 $
+ * $Revision: 23 $
*
*****************************************************************************/
@@ -66,6 +66,19 @@
length = source_desc->buffer.length;
/*
+ * If target is a buffer of length zero, allocate a new
+ * buffer of the proper length
+ */
+ if (target_desc->buffer.length == 0) {
+ target_desc->buffer.pointer = acpi_cm_allocate (length);
+ if (!target_desc->buffer.pointer) {
+ return (AE_NO_MEMORY);
+ }
+
+ target_desc->buffer.length = length;
+ }
+
+ /*
* Buffer is a static allocation,
* only place what will fit in the buffer.
*/
@@ -141,11 +154,11 @@
}
target_desc->string.pointer = acpi_cm_allocate (length + 1);
- target_desc->string.length = length;
-
if (!target_desc->string.pointer) {
return (AE_NO_MEMORY);
}
+ target_desc->string.length = length;
+
MEMCPY(target_desc->string.pointer, buffer, length);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)