All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp
@ 2019-10-24 12:46 ` Colin King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2019-10-24 12:46 UTC (permalink / raw)
  To: Bard Liao, Oder Chiou, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Curtis Malainey, Ben Zhang,
	alsa-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The allocation of rt5677_dsp can potentially fail and return null, so add
a null check and return -ENOMEM on a memory allocation failure.

Addresses-Coverity: ("Dereference null return")
Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 sound/soc/codecs/rt5677-spi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c
index 36c02d200cfc..3a17643fcd9f 100644
--- a/sound/soc/codecs/rt5677-spi.c
+++ b/sound/soc/codecs/rt5677-spi.c
@@ -376,6 +376,8 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component)
 
 	rt5677_dsp = devm_kzalloc(component->dev, sizeof(*rt5677_dsp),
 			GFP_KERNEL);
+	if (!rt5677_dsp)
+		return -ENOMEM;
 	rt5677_dsp->dev = &g_spi->dev;
 	mutex_init(&rt5677_dsp->dma_lock);
 	INIT_DELAYED_WORK(&rt5677_dsp->copy_work, rt5677_spi_copy_work);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH][next] ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp
@ 2019-10-24 12:46 ` Colin King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2019-10-24 12:46 UTC (permalink / raw)
  To: Bard Liao, Oder Chiou, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Curtis Malainey, Ben Zhang,
	alsa-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The allocation of rt5677_dsp can potentially fail and return null, so add
a null check and return -ENOMEM on a memory allocation failure.

Addresses-Coverity: ("Dereference null return")
Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 sound/soc/codecs/rt5677-spi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c
index 36c02d200cfc..3a17643fcd9f 100644
--- a/sound/soc/codecs/rt5677-spi.c
+++ b/sound/soc/codecs/rt5677-spi.c
@@ -376,6 +376,8 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component)
 
 	rt5677_dsp = devm_kzalloc(component->dev, sizeof(*rt5677_dsp),
 			GFP_KERNEL);
+	if (!rt5677_dsp)
+		return -ENOMEM;
 	rt5677_dsp->dev = &g_spi->dev;
 	mutex_init(&rt5677_dsp->dma_lock);
 	INIT_DELAYED_WORK(&rt5677_dsp->copy_work, rt5677_spi_copy_work);
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [alsa-devel] [PATCH][next] ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp
@ 2019-10-24 12:46 ` Colin King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2019-10-24 12:46 UTC (permalink / raw)
  To: Bard Liao, Oder Chiou, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Curtis Malainey, Ben Zhang,
	alsa-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The allocation of rt5677_dsp can potentially fail and return null, so add
a null check and return -ENOMEM on a memory allocation failure.

Addresses-Coverity: ("Dereference null return")
Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 sound/soc/codecs/rt5677-spi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c
index 36c02d200cfc..3a17643fcd9f 100644
--- a/sound/soc/codecs/rt5677-spi.c
+++ b/sound/soc/codecs/rt5677-spi.c
@@ -376,6 +376,8 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component)
 
 	rt5677_dsp = devm_kzalloc(component->dev, sizeof(*rt5677_dsp),
 			GFP_KERNEL);
+	if (!rt5677_dsp)
+		return -ENOMEM;
 	rt5677_dsp->dev = &g_spi->dev;
 	mutex_init(&rt5677_dsp->dma_lock);
 	INIT_DELAYED_WORK(&rt5677_dsp->copy_work, rt5677_spi_copy_work);
-- 
2.20.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH][next] ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp
  2019-10-24 12:46 ` Colin King
  (?)
@ 2019-10-24 17:15   ` Curtis Malainey
  -1 siblings, 0 replies; 9+ messages in thread
From: Curtis Malainey @ 2019-10-24 17:15 UTC (permalink / raw)
  To: Colin King
  Cc: Bard Liao, Oder Chiou, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Curtis Malainey, Ben Zhang,
	ALSA development, kernel-janitors, Linux Kernel Mailing List

On Thu, Oct 24, 2019 at 5:46 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The allocation of rt5677_dsp can potentially fail and return null, so add
> a null check and return -ENOMEM on a memory allocation failure.
>
> Addresses-Coverity: ("Dereference null return")
> Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Thanks

Acked-by Curtis Malainey <cujomalainey@chromium.org>
> ---
>  sound/soc/codecs/rt5677-spi.c | 2 ++
>  1 file changed, 2 insertions(+)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][next] ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp
@ 2019-10-24 17:15   ` Curtis Malainey
  0 siblings, 0 replies; 9+ messages in thread
From: Curtis Malainey @ 2019-10-24 17:15 UTC (permalink / raw)
  To: Colin King
  Cc: Oder Chiou, ALSA development, Linux Kernel Mailing List,
	kernel-janitors, Takashi Iwai, Liam Girdwood, Ben Zhang,
	Mark Brown, Bard Liao, Curtis Malainey

On Thu, Oct 24, 2019 at 5:46 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The allocation of rt5677_dsp can potentially fail and return null, so add
> a null check and return -ENOMEM on a memory allocation failure.
>
> Addresses-Coverity: ("Dereference null return")
> Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Thanks

Acked-by Curtis Malainey <cujomalainey@chromium.org>
> ---
>  sound/soc/codecs/rt5677-spi.c | 2 ++
>  1 file changed, 2 insertions(+)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [alsa-devel] [PATCH][next] ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp
@ 2019-10-24 17:15   ` Curtis Malainey
  0 siblings, 0 replies; 9+ messages in thread
From: Curtis Malainey @ 2019-10-24 17:15 UTC (permalink / raw)
  To: Colin King
  Cc: Oder Chiou, ALSA development, Linux Kernel Mailing List,
	kernel-janitors, Takashi Iwai, Liam Girdwood, Ben Zhang,
	Mark Brown, Bard Liao, Curtis Malainey

On Thu, Oct 24, 2019 at 5:46 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The allocation of rt5677_dsp can potentially fail and return null, so add
> a null check and return -ENOMEM on a memory allocation failure.
>
> Addresses-Coverity: ("Dereference null return")
> Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Thanks

Acked-by Curtis Malainey <cujomalainey@chromium.org>
> ---
>  sound/soc/codecs/rt5677-spi.c | 2 ++
>  1 file changed, 2 insertions(+)
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Applied "ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp" to the asoc tree
  2019-10-24 12:46 ` Colin King
  (?)
@ 2019-10-25 10:12   ` Mark Brown
  -1 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2019-10-25 10:12 UTC (permalink / raw)
  To: Colin Ian King
  Cc: alsa-devel, Bard Liao, Ben Zhang, Curtis Malainey,
	Jaroslav Kysela, kernel-janitors, Liam Girdwood, linux-kernel,
	Mark Brown, Oder Chiou, Takashi Iwai

The patch

   ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From f8a60435703bdde8f8a0ceb1aa8dad59df821583 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Thu, 24 Oct 2019 13:46:10 +0100
Subject: [PATCH] ASoC: rt5677: Add missing null check for failed allocation of
 rt5677_dsp

The allocation of rt5677_dsp can potentially fail and return null, so add
a null check and return -ENOMEM on a memory allocation failure.

Addresses-Coverity: ("Dereference null return")
Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20191024124610.18182-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5677-spi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c
index 36c02d200cfc..3a17643fcd9f 100644
--- a/sound/soc/codecs/rt5677-spi.c
+++ b/sound/soc/codecs/rt5677-spi.c
@@ -376,6 +376,8 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component)
 
 	rt5677_dsp = devm_kzalloc(component->dev, sizeof(*rt5677_dsp),
 			GFP_KERNEL);
+	if (!rt5677_dsp)
+		return -ENOMEM;
 	rt5677_dsp->dev = &g_spi->dev;
 	mutex_init(&rt5677_dsp->dma_lock);
 	INIT_DELAYED_WORK(&rt5677_dsp->copy_work, rt5677_spi_copy_work);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Applied "ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp" to the asoc tree
@ 2019-10-25 10:12   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2019-10-25 10:12 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Oder Chiou, alsa-devel, linux-kernel, Takashi Iwai,
	kernel-janitors, Liam Girdwood, Ben Zhang, Mark Brown, Bard Liao,
	Curtis Malainey

The patch

   ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From f8a60435703bdde8f8a0ceb1aa8dad59df821583 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Thu, 24 Oct 2019 13:46:10 +0100
Subject: [PATCH] ASoC: rt5677: Add missing null check for failed allocation of
 rt5677_dsp

The allocation of rt5677_dsp can potentially fail and return null, so add
a null check and return -ENOMEM on a memory allocation failure.

Addresses-Coverity: ("Dereference null return")
Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20191024124610.18182-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5677-spi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c
index 36c02d200cfc..3a17643fcd9f 100644
--- a/sound/soc/codecs/rt5677-spi.c
+++ b/sound/soc/codecs/rt5677-spi.c
@@ -376,6 +376,8 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component)
 
 	rt5677_dsp = devm_kzalloc(component->dev, sizeof(*rt5677_dsp),
 			GFP_KERNEL);
+	if (!rt5677_dsp)
+		return -ENOMEM;
 	rt5677_dsp->dev = &g_spi->dev;
 	mutex_init(&rt5677_dsp->dma_lock);
 	INIT_DELAYED_WORK(&rt5677_dsp->copy_work, rt5677_spi_copy_work);
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [alsa-devel] Applied "ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp" to the asoc tree
@ 2019-10-25 10:12   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2019-10-25 10:12 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Oder Chiou, alsa-devel, linux-kernel, Takashi Iwai,
	kernel-janitors, Liam Girdwood, Ben Zhang, Mark Brown, Bard Liao,
	Curtis Malainey

The patch

   ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From f8a60435703bdde8f8a0ceb1aa8dad59df821583 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Thu, 24 Oct 2019 13:46:10 +0100
Subject: [PATCH] ASoC: rt5677: Add missing null check for failed allocation of
 rt5677_dsp

The allocation of rt5677_dsp can potentially fail and return null, so add
a null check and return -ENOMEM on a memory allocation failure.

Addresses-Coverity: ("Dereference null return")
Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20191024124610.18182-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5677-spi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c
index 36c02d200cfc..3a17643fcd9f 100644
--- a/sound/soc/codecs/rt5677-spi.c
+++ b/sound/soc/codecs/rt5677-spi.c
@@ -376,6 +376,8 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component)
 
 	rt5677_dsp = devm_kzalloc(component->dev, sizeof(*rt5677_dsp),
 			GFP_KERNEL);
+	if (!rt5677_dsp)
+		return -ENOMEM;
 	rt5677_dsp->dev = &g_spi->dev;
 	mutex_init(&rt5677_dsp->dma_lock);
 	INIT_DELAYED_WORK(&rt5677_dsp->copy_work, rt5677_spi_copy_work);
-- 
2.20.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-10-25 10:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24 12:46 [PATCH][next] ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp Colin King
2019-10-24 12:46 ` [alsa-devel] " Colin King
2019-10-24 12:46 ` Colin King
2019-10-24 17:15 ` Curtis Malainey
2019-10-24 17:15   ` [alsa-devel] " Curtis Malainey
2019-10-24 17:15   ` Curtis Malainey
2019-10-25 10:12 ` Applied "ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp" to the asoc tree Mark Brown
2019-10-25 10:12   ` [alsa-devel] " Mark Brown
2019-10-25 10:12   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.