diff options
author | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-09-21 17:28:09 +1000 |
---|---|---|
committer | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-10-26 17:27:35 +1100 |
commit | 329a6c0e00cc58e4faceaa0ef4abd3aeb50fb2d5 (patch) | |
tree | 6ecd27b472e8b23378ae8caf0fd7111336d1574e | |
parent | d20d3b185bd84889a1e54b755a8198200c31bc7d (diff) |
Fix memory freeing of capture/playback streams
Since playback and capture streams are not always assigned, we do not want to
error when one or the other is not present for free'ing.
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r-- | core.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -168,10 +168,10 @@ static int avirt_probe(struct platform_device *devptr) static int avirt_remove(struct platform_device *devptr) { snd_card_free(core.card); - CHK_NULL(coreinfo.playback.streams); - kfree(coreinfo.playback.streams); - CHK_NULL(coreinfo.capture.streams); - kfree(coreinfo.capture.streams); + if (coreinfo.playback.streams) + kfree(coreinfo.playback.streams); + if (coreinfo.capture.streams) + kfree(coreinfo.capture.streams); return 0; } |