aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-09-21 17:28:09 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:35 +1100
commit329a6c0e00cc58e4faceaa0ef4abd3aeb50fb2d5 (patch)
tree6ecd27b472e8b23378ae8caf0fd7111336d1574e
parentd20d3b185bd84889a1e54b755a8198200c31bc7d (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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core.c b/core.c
index e1afce8..c9a9aa3 100644
--- a/core.c
+++ b/core.c
@@ -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;
}