|
@@ -1762,10 +1762,9 @@ static int snd_pcm_oss_get_formats(struct snd_pcm_oss_file *pcm_oss_file)
|
|
|
return -ENOMEM;
|
|
|
_snd_pcm_hw_params_any(params);
|
|
|
err = snd_pcm_hw_refine(substream, params);
|
|
|
- format_mask = hw_param_mask_c(params, SNDRV_PCM_HW_PARAM_FORMAT);
|
|
|
- kfree(params);
|
|
|
if (err < 0)
|
|
|
- return err;
|
|
|
+ goto error;
|
|
|
+ format_mask = hw_param_mask_c(params, SNDRV_PCM_HW_PARAM_FORMAT);
|
|
|
for (fmt = 0; fmt < 32; ++fmt) {
|
|
|
if (snd_mask_test(format_mask, fmt)) {
|
|
|
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)
|
|
|
formats |= f;
|
|
|
}
|
|
|
}
|
|
|
- return formats;
|
|
|
+
|
|
|
+ error:
|
|
|
+ kfree(params);
|
|
|
+ return err < 0 ? err : formats;
|
|
|
}
|
|
|
|
|
|
static int snd_pcm_oss_set_format(struct snd_pcm_oss_file *pcm_oss_file, int format)
|