Thread (8 messages) 8 messages, 4 authors, 2012-10-25

Re: [PATCH 2/2] Improve container_notify_cb() to support container hot-remove.

From: Mike Maslenkin <hidden>
Date: 2012-10-23 22:06:21

On Tue, 2012-10-23 at 21:10 +0800, Tang Chen wrote:
+static int container_device_remove(struct acpi_device *device)
+{
+	int ret;
+	struct acpi_eject_event *ej_event;
+
+	ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
+	if (!ej_event)
+		return -ENOMEM;
+
+	ej_event->device = device;
+	ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
+
+	/* stop container device at first */
+	ret = acpi_bus_trim(device, 0);
+	printk(KERN_WARNING "acpi_bus_trim stop return %x\n", ret);
+	if (ret)
+		return ret;
+
Looks like kfree() is missed here. Would it be better to stop container
before event allocation?


Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help