[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTim+CemMz7A3J94e1UywCNd0r1SABQ@mail.gmail.com>
Date: Tue, 28 Jun 2011 16:51:01 -0600
From: Grant Likely <grant.likely@...retlab.ca>
To: Ohad Ben-Cohen <ohad@...ery.com>
Cc: linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, akpm@...ux-foundation.org,
Brian Swetland <swetland@...gle.com>,
Arnd Bergmann <arnd@...db.de>,
davinci-linux-open-source
<davinci-linux-open-source@...ux.davincidsp.com>,
Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [RFC 7/8] drivers: introduce rpmsg, a remote-processor messaging bus
On Tue, Jun 28, 2011 at 4:46 PM, Ohad Ben-Cohen <ohad@...ery.com> wrote:
> Hi Grant,
>
> On Tue, Jun 28, 2011 at 1:21 AM, Grant Likely <grant.likely@...retlab.ca> wrote:
>>> +static int rpmsg_remove_device(struct device *dev, void *data)
>>> +{
>>> + struct rpmsg_channel *rpdev = to_rpmsg_channel(dev);
>>> +
>>> + device_unregister(dev);
>>> +
>>> + kfree(rpdev);
>>
>> put_device() I think.
>
> Don't think so, we get the device handle from device_for_each_child
> here, which doesn't call get_device (unlike device_find_child).
It's not the device_for_each_child() that you're 'putting' back from
here. Its the original kref initialization when the device was
created. Once a device is initialized, it must never be directly
kfree()'d.
g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists