diff options
author | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-11-20 18:28:11 +1100 |
---|---|---|
committer | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-11-20 18:28:11 +1100 |
commit | d84d13e2e3b6f6d2674fa4793c37eff6736f8577 (patch) | |
tree | 89f82f2efc71f9eca857d2fe9995cabbfd4604c7 | |
parent | af54a3dd7c7581a3039838591aec14720e854684 (diff) |
Ensure snd_avirt_private_free is not called if NULL
We only want to call the snd_avirt_private_free callback if it
is set. Some Audio Paths may only set the private data, and not
the private free callback, so we need to accommodate for this.
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r-- | core.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -210,10 +210,10 @@ static void pcm_private_data_free(struct snd_pcm *pcm) { struct snd_avirt_private_data *avirt_private_data; - D_PRINTK("Issuing free to private data struct"); - if (pcm->private_data) { - avirt_private_data = pcm->private_data; - if (avirt_private_data->ap_private_data) + avirt_private_data = (struct snd_avirt_private_data *)pcm->private_data; + if (avirt_private_data) { + if (avirt_private_data->ap_private_data && + avirt_private_data->ap_private_free) avirt_private_data->ap_private_free(pcm); } |