linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] sound: rt5645: fix a NULL pointer dereference
@ 2019-03-23 23:05 Aditya Pakki
  0 siblings, 0 replies; 2+ messages in thread
From: Aditya Pakki @ 2019-03-23 23:05 UTC (permalink / raw)
  To: Kangjie Lu
  Cc: Bard Liao, Oder Chiou, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel,
	20190315034833.25037-1-kjlu


On 3/14/19 10:48 PM, Kangjie Lu wrote:
> devm_kcalloc() may fail and return NULL. The fix returns ENOMEM
> in case it fails to avoid NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
>  sound/soc/codecs/rt5645.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
> index 9a0751978090..f842775dbf2c 100644
> --- a/sound/soc/codecs/rt5645.c
> +++ b/sound/soc/codecs/rt5645.c
> @@ -3419,6 +3419,9 @@ static int rt5645_probe(struct snd_soc_component *component)
>  		RT5645_HWEQ_NUM, sizeof(struct rt5645_eq_param_s),
>  		GFP_KERNEL);
>  
> +	if (!rt5645->eq_param)
> +		return -ENOMEM;
> +
>  	return 0;
>  }
>  


Friendly reminder, could someone review this patch ?


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH] sound: rt5645: fix a NULL pointer dereference
@ 2019-03-15  3:48 Kangjie Lu
  0 siblings, 0 replies; 2+ messages in thread
From: Kangjie Lu @ 2019-03-15  3:48 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Bard Liao, Oder Chiou, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel

devm_kcalloc() may fail and return NULL. The fix returns ENOMEM
in case it fails to avoid NULL pointer dereference.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 sound/soc/codecs/rt5645.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 9a0751978090..f842775dbf2c 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3419,6 +3419,9 @@ static int rt5645_probe(struct snd_soc_component *component)
 		RT5645_HWEQ_NUM, sizeof(struct rt5645_eq_param_s),
 		GFP_KERNEL);
 
+	if (!rt5645->eq_param)
+		return -ENOMEM;
+
 	return 0;
 }
 
-- 
2.17.1


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

end of thread, other threads:[~2019-03-23 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-23 23:05 [PATCH] sound: rt5645: fix a NULL pointer dereference Aditya Pakki
  -- strict thread matches above, loose matches on Subject: below --
2019-03-15  3:48 Kangjie Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).