]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: scan: Fix DMA range assignment
authorRobin Murphy <robin.murphy@arm.com>
Tue, 18 Oct 2022 13:14:04 +0000 (14:14 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 19 Oct 2022 18:27:31 +0000 (20:27 +0200)
commit4bc554ab6f91fc2a6751508b5bac947e053ea549
tree2f61067bba9144a677849b335d2dedf7f1cfafb6
parent6358759813eb1920a7e9bc57799a80a94f6c66b8
ACPI: scan: Fix DMA range assignment

Assigning the device's dma_range_map from the iterator variable after
the loop means it always points to the empty terminator at the end of
the map, which is not what we want. Similarly, freeing the iterator on
error when it points to somwhere in the middle of the allocated array
won't work either. Fix this.

Fixes: ac226ee176e0 ("ACPI: scan: Support multiple DMA windows with different offsets")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Jianmin Lv <lvjianmin@loongson.cn>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
Tested-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/scan.c