NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/51651: bogus locking in audio.c



>Number:         51651
>Category:       kern
>Synopsis:       bogus locking in audio.c
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 25 19:00:00 +0000 2016
>Originator:     David A. Holland
>Release:        NetBSD 7.99.42 (20161125)
>Organization:
>Environment:
System: n/a
Architecture: x86_64
Machine: amd64
>Description:

audio_enter takes two locks at once, both an ordinary mutex and an
additional hand-rolled reader/writer lock.

As far as I can tell, the reader/writer lock is acquired and released
exactly when the ordinary mutex is released so it is (a) not actually
reader/writer and (b) useless.

It isn't obvious up front how this got there; e.g. if it was a
starting point for someone's planned rearrangements to audio locking
that never got done.

>How-To-Repeat:

code inspection

>Fix:

I guess either get rid of it or figure out what the point was and move
in that direction...



Home | Main Index | Thread Index | Old Index