lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130208235524.GB24127@kroah.com>
Date:	Fri, 8 Feb 2013 15:55:24 -0800
From:	Greg KH <gregkh@...uxfoundation.org>
To:	Tomas Winkler <tomas.winkler@...el.com>
Cc:	sameo@...ux.intel.com, arnd@...db.de, linux-kernel@...r.kernel.org
Subject: Re: [char-misc-next 02/11 V2] mei: bus: Implement driver registration

On Fri, Feb 08, 2013 at 02:28:15PM +0200, Tomas Winkler wrote:
> From: Samuel Ortiz <sameo@...ux.intel.com>
> 
> Signed-off-by: Samuel Ortiz <sameo@...ux.intel.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@...el.com>
> Acked-by: Arnd Bergmann <arnd@...db.de>
> ---
>  drivers/misc/mei/bus.c  |   29 +++++++++++++++++++++++++++++
>  include/linux/mei_bus.h |    3 +++
>  2 files changed, 32 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
> index bb96423c..0a5e624 100644
> --- a/drivers/misc/mei/bus.c
> +++ b/drivers/misc/mei/bus.c
> @@ -153,3 +153,32 @@ void mei_remove_device(struct mei_bus_client *client)
>  	device_unregister(&client->dev);
>  }
>  EXPORT_SYMBOL(mei_remove_device);
> +
> +int mei_driver_register(struct mei_bus_driver *driver)
> +{
> +	int err;
> +
> +	/* Can't register until after driver model init */
> +	if (unlikely(WARN_ON(!mei_bus_type.p)))
> +		return -EAGAIN;

No, you really don't know what 'p' is, so don't assume you do.  You have
fields you can test to see if your driver model is up and registered,
use them instead.  Don't you think that something called 'p' is not
there for you to use?

> +	driver->driver.owner = THIS_MODULE;

Nope, this should be the module that owns the driver, not this one.  It
needs to be passed in with the call, or as part of the driver structure.

> +	driver->driver.bus = &mei_bus_type;
> +
> +	err = driver_register(&driver->driver);
> +	if (err)
> +		return err;
> +
> +	pr_debug("mei: driver [%s] registered\n", driver->driver.name);
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL(mei_driver_register);

_GPL() please?

> +
> +void mei_driver_unregister(struct mei_bus_driver *driver)
> +{
> +	driver_unregister(&driver->driver);
> +
> +	pr_debug("mei: driver [%s] unregistered\n", driver->driver.name);
> +}
> +EXPORT_SYMBOL(mei_driver_unregister);

Same here.

thanks,

greg k-h
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ