Re: BKL in tiglusb release function

From: Dave Hansen (haveblue@us.ibm.com)
Date: Fri Apr 05 2002 - 11:58:00 EST


Romain Liévin wrote:
> I have followed examples from other codes such as dabusb.c &
> printer.c (2.4.14). After a further look: - dabusb.c from 2.4.14
> contains a kernel_lock/unlock couple only in _release but it has
> been removed in 2.5.7 - printer.c contains a kernel_lock/unlock
> couple in _open & _release in both 2.4.14 and 2.5.7

I was probably responsible for the removal from dabusb.c. In almost all
cases that I found (over 60 of them), the BKL is not needed in the
release function.

The use of s->mutex confuses me. In tiglusb_disconnect(), there is an
up(). Where is the matching down? The comment for the mutex just says,
"locks this struct". However, it is clear that it doesn't protect the
whole structure. There are many places where structure members are
accessed without the lock being held.

-- 
Dave Hansen
haveblue@us.ibm.com

- 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/



This archive was generated by hypermail 2b29 : Sun Apr 07 2002 - 22:00:17 EST