On Tue, May 29, 2001 at 10:05:34AM +0200, Oliver Neukum wrote:
> > > You fail to set the flag for synchronous unlink. Thus all places where
> > > you use 'usb_unlink_urb' are race conditions. (a callback pointing into
> > > an unloaded module could be called)
> >
> > Hm, in looking over the other USB drivers, almost none of them set this
> > bit. So I've added it to the skel_release function, right before the
> > usb_unlink_urb function is called. Thanks for letting me know about
> > this.
>
> I am not sure whether you can do this. At least in the skeleton driver, I see
> no place where you actually would want _asynchronous_ unlink at all.
> Is there anything wrong with resetting this flag unconditionally before
> submission ?
No, you're right. I'll change that.
> > But the whole skel object is now freed. The fact that the semaphore was
> > set to down, shouldn't matter anymore, right? Or is it a better practice
> > to clear the semaphore (with a call to up()) before freeing the memory?
>
> If a task is blocking on a semaphore and you simply free the memory the
> semaphore is living in, the task will sleep forever.
Ah, forgot about that. But then again, the whole skel object will now
be gone too :)
thanks for the comments. I really appreciate them.
greg k-h
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel