From: Dan Cross Date: Wed, 14 Jun 2023 21:09:10 +0000 (+0000) Subject: pcm: hw: fix minor bug in sw_params ioctl X-Git-Tag: v1.2.10~33 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=b7389e2e2e11c8168e0c35a92a0d9c6ebb45aa59;p=alsa-lib.git pcm: hw: fix minor bug in sw_params ioctl Commit 2115cdb added a new call to the `SNDRV_PCM_IOCTL_SW_PARAMS` ioctl on line 675 of src/pcm/pcm_hw.c, but passed the `sw_params` argument by value; this should be passed by pointer. I ran across this in the context of the direwolf software modem for amateur radio; debugging details are in https://groups.io/g/direwolf/message/8286 Fixes: https://github.com/alsa-project/alsa-lib/pull/330 Signed-off-by: Dan Cross Signed-off-by: Jaroslav Kysela --- diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index b468a071..f488023a 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -672,7 +672,7 @@ static int snd_pcm_hw_prepare(snd_pcm_t *pcm) if (hw->prepare_reset_sw_params) { snd_pcm_sw_params_current_no_lock(pcm, &sw_params); - if (ioctl(hw->fd, SNDRV_PCM_IOCTL_SW_PARAMS, sw_params) < 0) { + if (ioctl(hw->fd, SNDRV_PCM_IOCTL_SW_PARAMS, &sw_params) < 0) { err = -errno; SYSMSG("SNDRV_PCM_IOCTL_SW_PARAMS failed (%i)", err); return err;