lkml.org 
[lkml]   [2019]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sound: rt5645: fix a NULL pointer dereference
From
Date

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 ?

\
 
 \ /
  Last update: 2019-03-24 00:06    [W:0.057 / U:7.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site