From: Tang Chen <tangchen@cn.fujitsu.com>
To: Mike Maslenkin <mihailm@parallels.com>
Cc: linux-acpi@vger.kernel.org
Subject: Re: [PATCH 2/2] Improve container_notify_cb() to support container hot-remove.
Date: Wed, 24 Oct 2012 09:51:23 +0800 [thread overview]
Message-ID: <5087499B.4050505@cn.fujitsu.com> (raw)
In-Reply-To: <1351029261.16186.3.camel@QWERTY1.site>
On 10/24/2012 05:54 AM, Mike Maslenkin wrote:
> 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?
Oh yes, my mistake.
And do the allocation after stopping container would be better. :)
Thanks.
>
>
> Mike.
>
>
prev parent reply other threads:[~2012-10-24 1:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 13:10 [PATCH 0/2] ACPI: container hot remove support Tang Chen
2012-10-23 13:10 ` [PATCH 1/2] Use kacpi_hotplug_wq to handle container hotplug event Tang Chen
2012-10-23 17:36 ` Yinghai Lu
2012-10-24 17:33 ` Toshi Kani
2012-10-25 1:24 ` Tang Chen
2012-10-23 13:10 ` [PATCH 2/2] Improve container_notify_cb() to support container hot-remove Tang Chen
2012-10-23 21:54 ` Mike Maslenkin
2012-10-24 1:51 ` Tang Chen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5087499B.4050505@cn.fujitsu.com \
--to=tangchen@cn.fujitsu.com \
--cc=linux-acpi@vger.kernel.org \
--cc=mihailm@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.