old_mask = *m;
changed = snd_mask_refine(m, constrs_mask(constrs, k));
+ if (changed < 0)
+ return changed;
trace_hw_mask_param(substream, k, 0, &old_mask, m);
/* Set corresponding flag so that the caller gets it. */
if (changed)
params->cmask |= 1 << k;
- if (changed < 0)
- return changed;
}
return 0;
old_interval = *i;
changed = snd_interval_refine(i, constrs_interval(constrs, k));
+ if (changed < 0)
+ return changed;
trace_hw_interval_param(substream, k, 0, &old_interval, i);
/* Set corresponding flag so that the caller gets it. */
if (changed)
params->cmask |= 1 << k;
- if (changed < 0)
- return changed;
}
return 0;
}
changed = r->func(params, r);
+ if (changed < 0)
+ return changed;
if (hw_is_mask(r->var)) {
trace_hw_mask_param(substream, r->var, k + 1,
vstamps[r->var] = stamp;
again = true;
}
- if (changed < 0)
- return changed;
+
stamp++;
}
return PTR_ERR(params);
err = snd_pcm_hw_refine(substream, params);
- if (err >= 0)
- err = fixup_unreferenced_params(substream, params);
- if (copy_to_user(_params, params, sizeof(*params))) {
- if (!err)
- err = -EFAULT;
- }
+ if (err < 0)
+ goto end;
+ err = fixup_unreferenced_params(substream, params);
+ if (err < 0)
+ goto end;
+
+ if (copy_to_user(_params, params, sizeof(*params)))
+ err = -EFAULT;
+end:
kfree(params);
return err;
}
return PTR_ERR(params);
err = snd_pcm_hw_params(substream, params);
- if (copy_to_user(_params, params, sizeof(*params))) {
- if (!err)
- err = -EFAULT;
- }
+ if (err < 0)
+ goto end;
+ if (copy_to_user(_params, params, sizeof(*params)))
+ err = -EFAULT;
+end:
kfree(params);
return err;
}
}
snd_pcm_hw_convert_from_old_params(params, oparams);
err = snd_pcm_hw_refine(substream, params);
- if (err >= 0)
- err = fixup_unreferenced_params(substream, params);
- snd_pcm_hw_convert_to_old_params(oparams, params);
- if (copy_to_user(_oparams, oparams, sizeof(*oparams))) {
- if (!err)
- err = -EFAULT;
- }
+ if (err < 0)
+ goto out_old;
+
+ err = fixup_unreferenced_params(substream, params);
+ if (err < 0)
+ goto out_old;
+ snd_pcm_hw_convert_to_old_params(oparams, params);
+ if (copy_to_user(_oparams, oparams, sizeof(*oparams)))
+ err = -EFAULT;
+out_old:
kfree(oparams);
out:
kfree(params);
err = PTR_ERR(oparams);
goto out;
}
+
snd_pcm_hw_convert_from_old_params(params, oparams);
err = snd_pcm_hw_params(substream, params);
- snd_pcm_hw_convert_to_old_params(oparams, params);
- if (copy_to_user(_oparams, oparams, sizeof(*oparams))) {
- if (!err)
- err = -EFAULT;
- }
+ if (err < 0)
+ goto out_old;
+ snd_pcm_hw_convert_to_old_params(oparams, params);
+ if (copy_to_user(_oparams, oparams, sizeof(*oparams)))
+ err = -EFAULT;
+out_old:
kfree(oparams);
out:
kfree(params);