Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ACPI: HMAT: release platform device in case of platform_device_add_da…
…ta() failure The platform device is not released when platform_device_add_data() fails. And platform_device_put() performs one more pointer check than put_device() to check for errors in the 'pdev' pointer. Use platform_device_put() to release platform device in platform_device_add()/platform_device_add_data()/ platform_device_add_resources() error case. Link: https://lkml.kernel.org/r/20220914033755.99924-1-linyujun809@huawei.com Fixes: c01044c ("ACPI: HMAT: refactor hmat_register_target_device to hmem_register_device") Signed-off-by: Lin Yujun <linyujun809@huawei.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Joao Martins <joao.m.martins@oracle.com> Cc: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
- Loading branch information