Re: [PATCH 1/4] driver core: add root_device_register()

Cornelia Huck
2008-12-12T08:43:00Z

On Thu, 11 Dec 2008 18:23:27 +0000,
Mark McLoughlin <markmc@redhat.com> wrote:

> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 8c2cc26..20e5825 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1196,6 +1196,93 @@ EXPORT_SYMBOL_GPL(put_device);
> EXPORT_SYMBOL_GPL(device_create_file);
> EXPORT_SYMBOL_GPL(device_remove_file);
>
> +struct root_device
> +{
> + struct device dev;
> + struct module *owner;
> +};
> +
> +static void root_device_release(struct device *dev)
> +{

You need to get the root device here and free that.

> + kfree(dev);
> +}