Re: patch usb-iowarrior.patch added to gregkh-2.6 tree

Samuel Ortiz <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Oliver Neukum wrote:
> Am Freitag, 16. Februar 2007 09:41 schrieb Samuel Ortiz:
> 
>> One stupid question: Suppose we're in iowarrior_read(), got a pointer on 
>> private_data, but haven't taken the mutex yet. iowarrior_release() is 
>> called, locks the mutex, decrements the opened counter to 0, and then 
>> call iowarrior_delete(). iowarrior_read() resumes, and tries to grab 
>> dev->mutex, but at that point dev is NULL, and we oops. How is that case 
>> handled ?
> 
> How do you close a file you are reading from? In a threaded task
> you can call close and read simultaneously, but the release method
> is called only when the last thread closes the fd.
Well, two process would share the same dev pointer, and I was thinking 
of process A closing the file and thus freeing dev while process B was 
in read(). But the driver doesn't allow multiple multiple open(), so 
that's taken care of.

Cheers,
Samuel.

-------------------------------------------------------------------------
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
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.