diff options
author | Dan Carpenter <error27@gmail.com> | 2010-04-27 00:23:37 +0200 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-04-27 03:15:08 -0400 |
commit | 5cc4a0f6b72878ea4e96fdb392d5d24c892a988e (patch) | |
tree | effe24b060128127beec419d1fbea2b910e72160 /drivers/acpi | |
parent | b91ce4d14a21fc04d165be30319541e0f9204f15 (diff) | |
download | kernel-common-5cc4a0f6b72878ea4e96fdb392d5d24c892a988e.tar.gz kernel-common-5cc4a0f6b72878ea4e96fdb392d5d24c892a988e.tar.bz2 kernel-common-5cc4a0f6b72878ea4e96fdb392d5d24c892a988e.zip |
ACPI: silence kmemcheck false positive
This addresses: https://bugzilla.kernel.org/show_bug.cgi?id=14998
We copy some strings into "event" but we leave the space after the NULL
terminators uninitialized. Later in acpi_bus_receive_event() we copy
the whole struct to another buffer with memcpy(). If the new buffer is
stored on the stack, kmemcheck prints a warning about the unitialized
space after the NULL terminators.
It's true that the space is uninitialized, but it's harmless. The
buffer is only used in acpi_system_read_event() and we don't read past
the NULL terminators.
This patch changes the kmalloc() to kzalloc() so that we initialize the
memory and silence the kmemcheck warning.
Reported-by: Christian Casteyde <casteyde.christian@free.fr>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 37132dc2da03..743576bf1bd7 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -527,7 +527,7 @@ int acpi_bus_generate_proc_event4(const char *device_class, const char *bus_id, if (!event_is_open) return 0; - event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC); + event = kzalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC); if (!event) return -ENOMEM; |