From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [RFC 7/8] drivers: introduce rpmsg, a remote-processor messaging bus Date: Tue, 28 Jun 2011 16:51:01 -0600 Message-ID: References: <1308640714-17961-1-git-send-email-ohad@wizery.com> <1308640714-17961-8-git-send-email-ohad@wizery.com> <20110627222121.GD20865@ponder.secretlab.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-yx0-f174.google.com ([209.85.213.174]:65112 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750948Ab1F1WvV convert rfc822-to-8bit (ORCPT ); Tue, 28 Jun 2011 18:51:21 -0400 In-Reply-To: Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Ohad Ben-Cohen Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, Brian Swetland , Arnd Bergmann , davinci-linux-open-source , Rusty Russell On Tue, Jun 28, 2011 at 4:46 PM, Ohad Ben-Cohen wrote= : > Hi Grant, > > On Tue, Jun 28, 2011 at 1:21 AM, Grant Likely wrote: >>> +static int rpmsg_remove_device(struct device *dev, void *data) >>> +{ >>> + =A0 =A0 struct rpmsg_channel *rpdev =3D to_rpmsg_channel(dev); >>> + >>> + =A0 =A0 device_unregister(dev); >>> + >>> + =A0 =A0 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-omap" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html