Subject: kern/23958: audio drivers returning NULL instead of 0 on audio interface allocm failure
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <email@example.com>
Date: 01/03/2004 11:39:20
>Synopsis: audio drivers returning NULL instead of 0 on audio interface allocm failure
>Arrival-Date: Sat Jan 03 11:40:00 UTC 2004
>Originator: Murray Armfield
i386, but not relevant
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.
Inspect code, for example... sys/dev/pci/cmpci.c : cmpci_allocm(...)
sys/dev/pci/eso.c : eso_allocm(...)
Change all relevant NULLs to 0 if required.