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: <20130901162441.GB32712@kroah.com>
Date:	Sun, 1 Sep 2013 09:24:41 -0700
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Guenter Roeck <linux@...ck-us.net>
Cc:	Jean Delvare <khali@...ux-fr.org>, lm-sensors@...sensors.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/9] hwmon: Introduce hwmon_device_register_with_groups

This looks good, just one minor question about the
non-driver-core-related code:

> +struct device *
> +hwmon_device_register_with_groups(struct device *dev, const char *name,
> +				  void *drvdata,
> +				  const struct attribute_group **groups)
>  {
> -	struct device *hwdev;
> -	int id;
> +	struct hwmon_device *hwdev;
> +	int err, id;
>  
>  	id = ida_simple_get(&hwmon_ida, 0, 0, GFP_KERNEL);
>  	if (id < 0)
>  		return ERR_PTR(id);

Don't you need a lock around the ida_simple_get call to ensure hwmon_ida
is not being used at the same time twice?  Or does the ida framework
handle that ok?

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