i2c: acpi: fix resource leak in reconfiguration device addition
mainline inclusion from mainline-v5.15-rc5 commit 6558b646 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9R4O7 CVE: CVE-2021-47425 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6558b646ce1c2a872fe1c2c7cb116f05a2c1950f ---------------------------------------------------- acpi_i2c_find_adapter_by_handle() calls bus_find_device() which takes a reference on the adapter which is never released which will result in a reference count leak and render the adapter unremovable. Make sure to put the adapter after creating the client in the same manner that we do for OF. Fixes: 525e6fab ("i2c / ACPI: add support for ACPI reconfigure notifications") Signed-off-by:Jamie Iles <quic_jiles@quicinc.com> Acked-by:
Mika Westerberg <mika.westerberg@linux.intel.com> [wsa: fixed title] Signed-off-by:
Wolfram Sang <wsa@kernel.org> Signed-off-by:
Zeng Heng <zengheng4@huawei.com>
Loading
Please sign in to comment