From: Takashi Iwai Date: Tue, 29 Aug 2023 13:43:44 +0000 (+0200) Subject: ALSA: pcm: Fix missing fixup call in compat hw_refine ioctl X-Git-Tag: v4.14.326~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=860e4a77ff24cbfc8cfe31f48756d3e18bfed4af;p=thirdparty%2Fkernel%2Fstable.git ALSA: pcm: Fix missing fixup call in compat hw_refine ioctl commit 358040e3807754944dbddf948a23c6d914297ed7 upstream. The update of rate_num/den and msbits were factored out to fixup_unreferenced_params() function to be called explicitly after the hw_refine or hw_params procedure. It's called from snd_pcm_hw_refine_user(), but it's forgotten in the PCM compat ioctl. This ended up with the incomplete rate_num/den and msbits parameters when 32bit compat ioctl is used. This patch adds the missing call in snd_pcm_ioctl_hw_params_compat(). Reported-by: Meng_Cai@novatek.com.cn Fixes: f9a076bff053 ("ALSA: pcm: calculate non-mask/non-interval parameters always when possible") Reviewed-by: Takashi Sakamoto Reviewed-by: Jaroslav Kysela Cc: Link: https://lore.kernel.org/r/20230829134344.31588-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index 6491afbb5fd57..6b8e64d053c1f 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c @@ -335,10 +335,14 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream, goto error; } - if (refine) + if (refine) { err = snd_pcm_hw_refine(substream, data); - else + if (err < 0) + goto error; + err = fixup_unreferenced_params(substream, data); + } else { err = snd_pcm_hw_params(substream, data); + } if (err < 0) goto error; if (copy_to_user(data32, data, sizeof(*data32)) ||