Hi, On 12/20/06, Greg KH <[EMAIL PROTECTED]> wrote: > From: Oliver Neukum <[EMAIL PROTECTED]> > > in disconnect you set the interface's private data to NULL. In your IO > methods you unconditionally follow the pointer into never never land. > > Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]> > Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> > --- > drivers/usb/misc/trancevibrator.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/usb/misc/trancevibrator.c > b/drivers/usb/misc/trancevibrator.c > index 33cd91d..67e2fc2 100644 > --- a/drivers/usb/misc/trancevibrator.c > +++ b/drivers/usb/misc/trancevibrator.c > @@ -120,8 +120,8 @@ static void tv_disconnect(struct usb_interface *interface) > struct trancevibrator *dev; > > dev = usb_get_intfdata (interface); > - usb_set_intfdata(interface, NULL); > device_remove_file(&interface->dev, &dev_attr_speed); > + usb_set_intfdata(interface, NULL); > usb_put_dev(dev->udev); > kfree(dev); > }
What does this change buy us? device_remove_file is not synchronous; If there is a process holding this attribute open whle disconnect is running it still may read/write to it after interface was set to NULL and dev freed. BTW, what is this device used for? Or maybe I don't want to know... -- Dmitry ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel