[PATCH] ACPI/HEST: fix boot failure when encountering duplicate source IDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While they should be unique, boot certainly shouldn't fail if the HEST
table isn't sane. The problem is that platform_device_release() wants
to kfree() ->dev.platform_data, which gets set to point into the
middle of some (allocated or mapped) enclosing table.

It appears safe to simply create a copy of the table (no data in there
should change post-boot); if it isn't, the pointer would need to be
cleared before dropping the device.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

---
 drivers/acpi/apei/hest.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.36-rc3/drivers/acpi/apei/hest.c
+++ 2.6.36-rc3-acpi-hest-error-path/drivers/acpi/apei/hest.c
@@ -150,7 +150,9 @@ static int hest_parse_ghes(struct acpi_h
 	ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id);
 	if (!ghes_dev)
 		return -ENOMEM;
-	ghes_dev->dev.platform_data = generic;
+	rc = platform_device_add_data(ghes_dev, generic, sizeof(*generic));
+	if (rc)
+		goto err;
 	rc = platform_device_add(ghes_dev);
 	if (rc)
 		goto err;



--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux