Re: acpi_battery_read_info kernel Oops

Ernst Herzberg
2003-02-22T00:31:57Z

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

On Freitag, 21. Februar 2003 02:48, Grover, Andrew wrote:
> Hi Ernst,
>
> Could you see if this patch fixes the issue?

Yupp. Look like the 'serial number' was the problem.

lidl ~ # cat /proc/acpi/battery/BAT0/info
present: yes
design capacity: 54720 mWh
last full capacity: 47600 mWh
battery technology: rechargeable
design voltage: 14400 mV
design capacity warning: 3808 mWh
design capacity low: 1428 mWh
capacity granularity 1: 238 mWh
capacity granularity 2: 238 mWh
model number: PC-VP-WP22/OP-570-74001
serial number:
battery type: Lion
OEM info: NEC

<Earny>

[-- Attachment #2: utcopy.diff --]
[-- Type: text/x-diff, Size: 1343 bytes --]

===== drivers/acpi/utilities/utcopy.c 1.22 vs edited =====
--- 1.22/drivers/acpi/utilities/utcopy.c Tue Feb 18 15:32:34 2003
+++ edited/drivers/acpi/utilities/utcopy.c Thu Feb 20 17:44:54 2003
@@ -645,11 +645,11 @@

/*
* Allocate and copy the actual buffer if and only if:
- * 1) There is a valid buffer (length > 0)
+ * 1) There is a valid buffer pointer
* 2) The buffer is not static (not in an ACPI table) (in this case,
* the actual pointer was already copied above)
*/
- if ((source_desc->buffer.length) &&
+ if ((source_desc->buffer.pointer) &&
(!(source_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
dest_desc->buffer.pointer = ACPI_MEM_ALLOCATE (source_desc->buffer.length);
if (!dest_desc->buffer.pointer) {
@@ -665,11 +665,11 @@

/*
* Allocate and copy the actual string if and only if:
- * 1) There is a valid string (length > 0)
+ * 1) There is a valid string pointer
* 2) The string is not static (not in an ACPI table) (in this case,
* the actual pointer was already copied above)
*/
- if ((source_desc->string.length) &&
+ if ((source_desc->string.pointer) &&
(!(source_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
dest_desc->string.pointer = ACPI_MEM_ALLOCATE ((acpi_size) source_desc->string.length + 1);
if (!dest_desc->string.pointer) {