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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B1AE738C0@HASMSX106.ger.corp.intel.com>
Date:	Wed, 24 Jul 2013 16:20:32 +0000
From:	"Winkler, Tomas" <tomas.winkler@...el.com>
To:	Greg KH <gregkh@...uxfoundation.org>
CC:	"arnd@...db.de" <arnd@...db.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Ovsyanikov, Natalia" <natalia.ovsyanikov@...el.com>
Subject: RE: [char-misc-next 2/3] mei: adding sysfs fw_status attribute



> >  int mei_register(struct mei_device *dev)  {
> > +	struct device *device = &dev->pdev->dev;
> >  	int ret;
> > -	mei_misc_device.parent = &dev->pdev->dev;
> > +
> > +	mei_misc_device.parent = device;
> >  	ret = misc_register(&mei_misc_device);
> >  	if (ret)
> >  		return ret;
> >
> > +	ret = sysfs_create_group(&device->kobj, &mei_attr_group);
> > +	if (ret)
> > +		return ret;
> 

> And you just lost the race with userspace (you told it you had a device, it
> went and scanned your attributes and saved them, then you registered
> more...)
> 
> Please use the dev_groups field for your class to properly have the driver
> core register these before userspace is told about the device, that's the
> correct way to do this.

Just to make sure, is this what you're suggesting ?

device->groups = mei_attr_groups
mei_misc_device.parent = device;
ret = misc_register(&mei_misc_device);

Thanks
Tomas 

--
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