lkml.org 
[lkml]   [2006]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: O2micro smartcard reader driver.
Date
Am Dienstag, 12. Dezember 2006 22:28 schrieb Eric Piel:

Hi

> Thanks a lot for reading my code, I didn't even hope that someone would!
> I've corrected the copy_to_user (and copy_from_user) code. However I
> don't know how to do locking for the concurrent ioctls. Indeed, I don't
> think there is anything preventing two programs to call the driver at
> the same time. Unfortunately, I've got no idea how to do the locking and
> surprisingly couldn't find any ioctl code in the kernel doing locking.
> Maybe I've just not looked at the right place, could you give a me some
> hint how to do locking for ioctl's ?

I take it back. Reading your code again, it seems to me that it'll
never sleep. In this case you are protected by BKL. If not, you need
to use mutexes, just like eg. in drivers/usb/class/usblp.c

HTH
Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-12-12 23:07    [W:0.512 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site