aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/oss/pcm_oss.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-20 06:27:18 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-20 06:27:18 -0400
commit4958134df54c2c84e9c22ea042761d439164d26e (patch)
tree503177afab11f7d25b12a84ce25b481d305c51ba /sound/core/oss/pcm_oss.c
parentc4f528795d1add8b63652673f7262729f679c6c1 (diff)
parentc698ca5278934c0ae32297a8725ced2e27585d7f (diff)
Merge 4.16-rc6 into tty-next
We want the serial/tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/core/oss/pcm_oss.c')
-rw-r--r--sound/core/oss/pcm_oss.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index b044c0a5a674..02298c9c6020 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -1762,10 +1762,9 @@ static int snd_pcm_oss_get_formats(struct snd_pcm_oss_file *pcm_oss_file)
1762 return -ENOMEM; 1762 return -ENOMEM;
1763 _snd_pcm_hw_params_any(params); 1763 _snd_pcm_hw_params_any(params);
1764 err = snd_pcm_hw_refine(substream, params); 1764 err = snd_pcm_hw_refine(substream, params);
1765 format_mask = hw_param_mask_c(params, SNDRV_PCM_HW_PARAM_FORMAT);
1766 kfree(params);
1767 if (err < 0) 1765 if (err < 0)
1768 return err; 1766 goto error;
1767 format_mask = hw_param_mask_c(params, SNDRV_PCM_HW_PARAM_FORMAT);
1769 for (fmt = 0; fmt < 32; ++fmt) { 1768 for (fmt = 0; fmt < 32; ++fmt) {
1770 if (snd_mask_test(format_mask, fmt)) { 1769 if (snd_mask_test(format_mask, fmt)) {
1771 int f = snd_pcm_oss_format_to(fmt); 1770 int f = snd_pcm_oss_format_to(fmt);
@@ -1773,7 +1772,10 @@ static int snd_pcm_oss_get_formats(struct snd_pcm_oss_file *pcm_oss_file)
1773 formats |= f; 1772 formats |= f;
1774 } 1773 }
1775 } 1774 }
1776 return formats; 1775
1776 error:
1777 kfree(params);
1778 return err < 0 ? err : formats;
1777} 1779}
1778 1780
1779static int snd_pcm_oss_set_format(struct snd_pcm_oss_file *pcm_oss_file, int format) 1781static int snd_pcm_oss_set_format(struct snd_pcm_oss_file *pcm_oss_file, int format)