NetBSD-Bugs archive

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

kern/52433: Dead code in audio_open()



>Number:         52433
>Category:       kern
>Synopsis:       Dead code in audio_open()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 27 09:00:00 +0000 2017
>Originator:     Tetsuya Isaki
>Release:        NetBSD-current
>Organization:
NetBSD
>Environment:
source code review
>Description:
Dead code in audio_open()

In sys/dev/audio.c, the expression at line 2167-2168 never be true.

2114 audio_open(dev_t dev, struct audio_softc *sc, int flags, int ifmt,
2115     struct lwp *l, struct file **nfp)
2116 {
   :
2147     vc->sc_open = 0; 
2148     vc->sc_mode = 0; 
   :
2167     if (((flags & FREAD) && (vc->sc_open & AUOPEN_READ)) || 
2168         ((flags & FWRITE) && (vc->sc_open & AUOPEN_WRITE))) {
2169         kmem_free(vc, sizeof(struct virtual_channel));
2170         kmem_free(chan, sizeof(struct audio_chan));
2171         return EBUSY;
2172     }  

>How-To-Repeat:
see source code.
>Fix:
N/A



Home | Main Index | Thread Index | Old Index