mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
wcd9335: fix a incorrect use of kstrndup()
In wcd9335_codec_enable_dec(), 'widget_name' is allocated by kstrndup(). However, according to doc: "Note: Use kmemdup_nul() instead if the size is known exactly." So we should use kmemdup_nul() here instead of kstrndup(). Signed-off-by: Gen Zhang <blackgod016574@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
99a12c766e
commit
a549881139
@ -2734,7 +2734,7 @@ static int wcd9335_codec_enable_dec(struct snd_soc_dapm_widget *w,
|
||||
char *dec;
|
||||
u8 hpf_coff_freq;
|
||||
|
||||
widget_name = kstrndup(w->name, 15, GFP_KERNEL);
|
||||
widget_name = kmemdup_nul(w->name, 15, GFP_KERNEL);
|
||||
if (!widget_name)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user