summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_platform.c
diff options
context:
space:
mode:
authorToshi Kani <toshi.kani@hpe.com>2016-01-26 21:57:25 +0100
committerIngo Molnar <mingo@kernel.org>2016-01-30 09:49:58 +0100
commit9a975bee4b3945b271bcff18a520d4863c210f8b (patch)
tree959343e154bda576c7bcb061b50e9c3208811261 /drivers/acpi/acpi_platform.c
parent782b86641e5d471e9eb1cf0072c012d2f758e568 (diff)
downloadlinux-9a975bee4b3945b271bcff18a520d4863c210f8b.tar.bz2
drivers: Initialize resource entry to zero
I/O resource descriptor, 'desc' in struct resource, needs to be initialized to zero by default. Some drivers call kmalloc() to allocate a resource entry, but do not initialize it to zero by memset(). Change these drivers to call kzalloc(), instead. Signed-off-by: Toshi Kani <toshi.kani@hpe.com> Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Alexandre Bounine <alexandre.bounine@idt.com> Acked-by: Helge Deller <deller@gmx.de> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Luis R. Rodriguez <mcgrof@suse.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Toshi Kani <toshi.kani@hp.com> Cc: linux-acpi@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-mm <linux-mm@kvack.org> Cc: linux-parisc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-sh@vger.kernel.org Link: http://lkml.kernel.org/r/1453841853-11383-10-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/acpi/acpi_platform.c')
-rw-r--r--drivers/acpi/acpi_platform.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 296b7a14893a..b6f7fa3a1d40 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -62,7 +62,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev)
if (count < 0) {
return NULL;
} else if (count > 0) {
- resources = kmalloc(count * sizeof(struct resource),
+ resources = kzalloc(count * sizeof(struct resource),
GFP_KERNEL);
if (!resources) {
dev_err(&adev->dev, "No memory for resources\n");