[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200612122305.53767.oliver@neukum.org>
Date: Tue, 12 Dec 2006 23:05:53 +0100
From: Oliver Neukum <oliver@...kum.org>
To: Eric Piel <Eric.Piel@...mplin-utc.net>
Cc: linux-kernel@...r.kernel.org
Subject: Re: O2micro smartcard reader driver.
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists