Lin Yujun 6a02124c87 ACPI: HMAT: Release platform device in case of platform_device_add_data() fails
The platform device is not released when platform_device_add_data()
fails. And platform_device_put() perfom 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.

Fixes: c01044cc8191 ("ACPI: HMAT: refactor hmat_register_target_device to hmem_register_device")
Signed-off-by: Lin Yujun <linyujun809@huawei.com>
Link: https://lore.kernel.org/r/20220914033755.99924-1-linyujun809@huawei.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2022-09-29 17:54:29 -07:00
..
2021-11-24 19:21:35 -08:00
2021-12-04 08:58:51 -08:00
2021-11-24 19:21:35 -08:00
2021-11-24 19:21:35 -08:00