summaryrefslogtreecommitdiff
path: root/net/ipv4/ip_forward.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-01-14 21:46:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-30 15:40:11 +0300
commitd39b29aa985dfc7496e796e6d3f155e6bd69a4b9 (patch)
tree0dd33ec03aa8f30d195483a12a52a27da35fd48c /net/ipv4/ip_forward.c
parentaea037bb753c7aa647d8754635af972cc58ebe3f (diff)
downloadlinux-d39b29aa985dfc7496e796e6d3f155e6bd69a4b9.tar.xz
ACPI: scan: Rearrange memory allocation in acpi_device_add()
[ Upstream commit c1013ff7a5472db637c56bb6237f8343398c03a7 ] The upfront allocation of new_bus_id is done to avoid allocating memory under acpi_device_lock, but it doesn't really help, because (1) it leads to many unnecessary memory allocations for _ADR devices, (2) kstrdup_const() is run under that lock anyway and (3) it complicates the code. Rearrange acpi_device_add() to allocate memory for a new struct acpi_device_bus_id instance only when necessary, eliminate a redundant local variable from it and reduce the number of labels in there. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ipv4/ip_forward.c')
0 files changed, 0 insertions, 0 deletions