Page MenuHomeFreeBSD

sound: Fix memory leak in chn_init()
ClosedPublic

Authored by christos on Jul 15 2024, 3:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 15, 4:31 PM
Unknown Object (File)
Sat, Aug 8, 3:13 AM
Unknown Object (File)
Fri, Aug 7, 12:53 AM
Unknown Object (File)
Thu, Aug 6, 5:35 AM
Unknown Object (File)
Wed, Aug 5, 1:30 PM
Unknown Object (File)
Thu, Jul 30, 7:59 AM
Unknown Object (File)
Sun, Jul 26, 7:51 PM
Unknown Object (File)
Sun, Jul 26, 3:00 PM
Subscribers

Details

Summary

In case chn_init() fails, we are leaking memory by not freeing the
feeder.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Jul 19 2024, 12:01 AM
markj added inline comments.
sys/dev/sound/pcm/channel.c
1369

Since this strange-looking while loop appears in several places now, it would a good idea to move it into a subroutine.

sys/dev/sound/pcm/channel.c
1369

Maybe it's better to just modify the function directly?

sys/dev/sound/pcm/channel.c
1369

That works too.

christos added inline comments.
sys/dev/sound/pcm/channel.c
1369
This revision was automatically updated to reflect the committed changes.
christos marked an inline comment as done.