Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a83893ae authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown
Browse files

ACPI: fix bus scanning memory leaks

Free an acpi_get_object_info() buffer when we're finished.  Skip the
acpi_get_name() altogether -- it was only used for a printk that was
really just for debug anyway.

http://bugzilla.kernel.org/show_bug.cgi?id=14271



Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Reported-and-tested-by: default avatarZdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 0efe5e32
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1052,6 +1052,8 @@ static void acpi_device_set_id(struct acpi_device *device)
			device->flags.bus_address = 1;
		}

		kfree(info);

		/*
		 * Some devices don't reliably have _HIDs & _CIDs, so add
		 * synthetic HIDs to make sure drivers can find them.
@@ -1325,13 +1327,8 @@ static int acpi_bus_scan(acpi_handle handle, struct acpi_bus_ops *ops,
			 struct acpi_device **child)
{
	acpi_status status;
	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
	void *device = NULL;

	acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
	printk(KERN_INFO PREFIX "Enumerating devices from [%s]\n",
	       (char *) buffer.pointer);

	status = acpi_bus_check_add(handle, 0, ops, &device);
	if (ACPI_SUCCESS(status))
		acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,