drivers/usb/hub/acpi.c: Don't use heap for ACPI name
commit5d8fe86db2de0036b190e164e5926262404afcb8
authorArthur Heymans <arthur@aheymans.xyz>
Fri, 13 May 2022 15:30:47 +0000 (13 17:30 +0200)
committerFelix Held <felix-coreboot@felixheld.de>
Fri, 16 Sep 2022 13:05:19 +0000 (16 13:05 +0000)
tree12f8f6cb7e4a72bf84acb0ed0e38d59e77f11697
parent4d9748f87c500376ce015413c660e4ad58d4eef8
drivers/usb/hub/acpi.c: Don't use heap for ACPI name

Using malloc would increase the heap use each time this function is
called. Instead allocate a per struct device buffer inside the
chip_info struct.

Found by coverity scan, CID 1488815.

Change-Id: Ie24870b34338624b3bf3a6f420debdd24a68ffbd
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64338
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
src/drivers/usb/hub/acpi.c
src/drivers/usb/hub/chip.h