RE: [PATCH v2 03/14] vfio: Split creation of a vfio_device into init and register ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Sent: Tuesday, March 16, 2021 9:34 PM
> 
> On Tue, Mar 16, 2021 at 07:55:11AM +0000, Tian, Kevin wrote:
> 
> > > +void *vfio_del_group_dev(struct device *dev)
> > > +{
> > > +	struct vfio_device *device = dev_get_drvdata(dev);
> > > +	void *device_data = device->device_data;
> > > +
> > > +	vfio_unregister_group_dev(device);
> > >  	dev_set_drvdata(dev, NULL);
> >
> > Move to vfio_unregister_group_dev? In the cover letter you mentioned
> > that drvdata is managed by the driver but removed from the core.
> 
> "removed from the core" means the core code doesn't touch drvdata at
> all.
> 
> > Looks it's also the rule obeyed by the following patches.
> 
> The dev_set_drvdata(NULL) on remove is mostly cargo-cult nonsense. The
> driver core sets it to null immediately after the remove function
> returns, so to add another set needs a very strong reason.
> 
> It is only left here temporarily, the last patch deletes it.
> 

Ah, I didn't realize dev_set_drvdata(NULL) is nonsense here. Just saw
no place clears it after this series. 

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux