lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210519104842.977895-4-codrin.ciubotariu@microchip.com>
Date:   Wed, 19 May 2021 13:48:39 +0300
From:   Codrin Ciubotariu <codrin.ciubotariu@...rochip.com>
To:     <alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>
CC:     <perex@...ex.cz>, <tiwai@...e.com>,
        <pierre-louis.bossart@...ux.intel.com>, <broonie@...nel.org>,
        <joe@...ches.com>, <lgirdwood@...il.com>, <lars@...afoo.de>,
        <kuninori.morimoto.gx@...esas.com>, <nicolas.ferre@...rochip.com>,
        <Cristian.Birsan@...rochip.com>,
        Codrin Ciubotariu <codrin.ciubotariu@...rochip.com>
Subject: [RFC PATCH 3/6] ALSA: pcm: Check for substream->ops before substream->ops->mmap

substreams, like the internal ones, might not have ops set. Check it,
before looking at substream->ops->mmap.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@...rochip.com>
---
 sound/core/pcm_native.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 54e0eab2a57e..cb0164d55593 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -246,7 +246,7 @@ static bool hw_support_mmap(struct snd_pcm_substream *substream)
 	if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_MMAP))
 		return false;
 
-	if (substream->ops->mmap ||
+	if ((substream->ops && substream->ops->mmap) ||
 	    (substream->dma_buffer.dev.type != SNDRV_DMA_TYPE_DEV &&
 	     substream->dma_buffer.dev.type != SNDRV_DMA_TYPE_DEV_UC))
 		return true;
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ