Page MenuHomeFreeBSD

sound: Create a dsp_close() helper function
AcceptedPublic

Authored by christos on Sat, Apr 12, 8:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 17, 2:57 PM
Unknown Object (File)
Thu, Apr 17, 1:41 PM
Unknown Object (File)
Thu, Apr 17, 9:53 AM
Unknown Object (File)
Thu, Apr 17, 2:45 AM
Unknown Object (File)
Thu, Apr 17, 2:10 AM
Unknown Object (File)
Wed, Apr 16, 8:31 AM
Unknown Object (File)
Sun, Apr 13, 5:52 PM
Unknown Object (File)
Sun, Apr 13, 5:14 AM
Subscribers

Details

Summary

Needed by follow-up patch.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63481
Build 60365: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Sun, Apr 13, 4:02 PM
sys/dev/sound/pcm/dsp.c
268

So where are these non-NULL checks in the new code?

sys/dev/sound/pcm/dsp.c
268

At the very beginning of dsp_close_chan().

sys/dev/sound/pcm/dsp.c
268

Are the values of priv->{rd,wr}ch stable? You are now checking for their non-NULL after priv->sc acquire.

sys/dev/sound/pcm/dsp.c
268

Primary (i.e., non-vchan) channels are destroyed during detach (see pcm_killchans()), and vchans in dsp_close() (see vchan_destroy()). So I think it's safe to leave the check as is. If we're detaching, we'll catch that a few lines below and bail-out anyway, and for vchans, well, we destroy them here only.