Subject: kern/23958: audio drivers returning NULL instead of 0 on audio interface allocm failure
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <murray@river-styx.org>
List: netbsd-bugs
Date: 01/03/2004 11:39:20
>Number:         23958
>Category:       kern
>Synopsis:       audio drivers returning NULL instead of 0 on audio interface allocm failure
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 03 11:40:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Murray Armfield
>Release:        NetBSD-current
>Organization:
>Environment:
i386, but not relevant
>Description:
While still pulling my hair out playing with the cmpci audio driver, I noticed that a failure on allocm routine as documented in man 9 audio and as found in audio.c specifically tests for 0 as a failure code. Many audio drivers are return NULL on failure instead. Traditionally, this is bad as we all know, however I have some vague recollection that NULL has been made equivalent to 0 or I may be completely wrong. Please look at cmpci.c, emuxki.c, eso.c and probably others.
>How-To-Repeat:
Inspect code, for example... sys/dev/pci/cmpci.c : cmpci_allocm(...)
sys/dev/pci/eso.c : eso_allocm(...)
>Fix:
Change all relevant NULLs to 0 if required.
>Release-Note:
>Audit-Trail:
>Unformatted: