Revert "ALSA: pcm: Check for null pointer of pointer substream before dereferencing it"

This reverts commit b2421a196c which is
commit 011b559be832194f992f73d6c0d5485f5925a10b upstream.

It breaks the Android abi.  If it is required in the future, it can
come back in an abi-safe way.

Bug: 161946584
Change-Id: I4278870e1e9f98ba86e52d588d1b208a6b3255ba
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2023-08-31 13:44:32 +00:00
parent ef75d6901c
commit 3a3afa870a

View File

@@ -401,6 +401,7 @@ EXPORT_SYMBOL(snd_pcm_lib_malloc_pages);
*/
int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream)
{
struct snd_card *card = substream->pcm->card;
struct snd_pcm_runtime *runtime;
if (PCM_RUNTIME_CHECK(substream))
@@ -409,8 +410,6 @@ int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream)
if (runtime->dma_area == NULL)
return 0;
if (runtime->dma_buffer_p != &substream->dma_buffer) {
struct snd_card *card = substream->pcm->card;
/* it's a newly allocated buffer. release it now. */
do_free_pages(card, runtime->dma_buffer_p);
kfree(runtime->dma_buffer_p);