pcm: Preserve period_event in snd_pcm_hw_sw_params() call
pcm: Preserve period_event in snd_pcm_hw_sw_params() call

snd_pcm_hw_sw_params() in pcm_hw.c tries to abuse the reserved bits
for passing period_Event flag.  In this hackish way, we clear the
reserved bits at beginning, and restore before returning.  However,
the code paths that return earlier don't restore the value, hence when
user calls this function twice, it may pass an unexpected value.

This patch fixes the failure, restoring the value always before
returning from the function.

Reported-by: Jamey Sharp <167c1dcbbc9c320e8e02a0c15c886204b4e658a4@minilop.net>
Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

takaswie/alsa-lib,alsa-project/alsa-lib,takaswie/alsa-lib,takaswie/alsa-lib,tiwai/alsa-lib,tiwai/alsa-lib,alsa-project/alsa-lib,alsa-project/alsa-lib,tiwai/alsa-lib,alsa-project/alsa-lib,takaswie/alsa-lib,tiwai/alsa-lib,takaswie/alsa-lib