unsigned int numid,
int *left, int *right)
{
- struct snd_ctl_elem_info *uinfo __free(kfree) = NULL;
- struct snd_ctl_elem_value *uctl __free(kfree) = NULL;
struct snd_kcontrol *kctl;
struct snd_card *card = fmixer->card;
kctl = snd_ctl_find_numid(card, numid);
if (!kctl)
return;
- uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
- uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
+
+ struct snd_ctl_elem_info *uinfo __free(kfree) =
+ kzalloc(sizeof(*uinfo), GFP_KERNEL);
+ struct snd_ctl_elem_value *uctl __free(kfree) =
+ kzalloc(sizeof(*uctl), GFP_KERNEL);
if (uinfo == NULL || uctl == NULL)
return;
if (kctl->info(kctl, uinfo))
int *left, int *right,
int route)
{
- struct snd_ctl_elem_info *uinfo __free(kfree) = NULL;
- struct snd_ctl_elem_value *uctl __free(kfree) = NULL;
struct snd_kcontrol *kctl;
struct snd_card *card = fmixer->card;
kctl = snd_ctl_find_numid(card, numid);
if (!kctl)
return;
- uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
- uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
+
+ struct snd_ctl_elem_info *uinfo __free(kfree) =
+ kzalloc(sizeof(*uinfo), GFP_KERNEL);
+ struct snd_ctl_elem_value *uctl __free(kfree) =
+ kzalloc(sizeof(*uctl), GFP_KERNEL);
if (uinfo == NULL || uctl == NULL)
return;
if (kctl->info(kctl, uinfo))
unsigned int numid,
int left, int right)
{
- struct snd_ctl_elem_info *uinfo __free(kfree) = NULL;
- struct snd_ctl_elem_value *uctl __free(kfree) = NULL;
struct snd_kcontrol *kctl;
struct snd_card *card = fmixer->card;
int res;
kctl = snd_ctl_find_numid(card, numid);
if (!kctl)
return;
- uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
- uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
+
+ struct snd_ctl_elem_info *uinfo __free(kfree) =
+ kzalloc(sizeof(*uinfo), GFP_KERNEL);
+ struct snd_ctl_elem_value *uctl __free(kfree) =
+ kzalloc(sizeof(*uctl), GFP_KERNEL);
if (uinfo == NULL || uctl == NULL)
return;
if (kctl->info(kctl, uinfo))
int left, int right,
int route)
{
- struct snd_ctl_elem_info *uinfo __free(kfree) = NULL;
- struct snd_ctl_elem_value *uctl __free(kfree) = NULL;
struct snd_kcontrol *kctl;
struct snd_card *card = fmixer->card;
int res;
kctl = snd_ctl_find_numid(card, numid);
if (!kctl)
return;
- uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
- uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
+
+ struct snd_ctl_elem_info *uinfo __free(kfree) =
+ kzalloc(sizeof(*uinfo), GFP_KERNEL);
+ struct snd_ctl_elem_value *uctl __free(kfree) =
+ kzalloc(sizeof(*uctl), GFP_KERNEL);
if (uinfo == NULL || uctl == NULL)
return;
if (kctl->info(kctl, uinfo))
struct snd_kcontrol *kctl;
struct snd_mixer_oss_slot *pslot;
struct slot *slot;
- struct snd_ctl_elem_info *uinfo __free(kfree) = NULL;
- struct snd_ctl_elem_value *uctl __free(kfree) = NULL;
int err, idx;
- uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
- uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
+ struct snd_ctl_elem_info *uinfo __free(kfree) =
+ kzalloc(sizeof(*uinfo), GFP_KERNEL);
+ struct snd_ctl_elem_value *uctl __free(kfree) =
+ uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
if (uinfo == NULL || uctl == NULL)
return -ENOMEM;
guard(rwsem_read)(&card->controls_rwsem);
struct snd_kcontrol *kctl;
struct snd_mixer_oss_slot *pslot;
struct slot *slot = NULL;
- struct snd_ctl_elem_info *uinfo __free(kfree) = NULL;
- struct snd_ctl_elem_value *uctl __free(kfree) = NULL;
int err;
unsigned int idx;
- uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
- uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
+ struct snd_ctl_elem_info *uinfo __free(kfree) =
+ kzalloc(sizeof(*uinfo), GFP_KERNEL);
+ struct snd_ctl_elem_value *uctl __free(kfree) =
+ kzalloc(sizeof(*uctl), GFP_KERNEL);
if (uinfo == NULL || uctl == NULL)
return -ENOMEM;
guard(rwsem_read)(&card->controls_rwsem);
static int snd_mixer_oss_build_test(struct snd_mixer_oss *mixer, struct slot *slot, const char *name, int index, int item)
{
- struct snd_ctl_elem_info *info __free(kfree) = NULL;
struct snd_kcontrol *kcontrol;
struct snd_card *card = mixer->card;
int err;
+ struct snd_ctl_elem_info *info __free(kfree) =
+ kmalloc(sizeof(*info), GFP_KERNEL);
+ if (!info)
+ return -ENOMEM;
scoped_guard(rwsem_read, &card->controls_rwsem) {
kcontrol = snd_mixer_oss_test_id(mixer, name, index);
if (kcontrol == NULL)
return 0;
- info = kmalloc(sizeof(*info), GFP_KERNEL);
- if (!info)
- return -ENOMEM;
err = kcontrol->info(kcontrol, info);
if (err < 0)
return err;
if (!ptr->index)
kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0);
if (kctl) {
- struct snd_ctl_elem_info *uinfo __free(kfree) = NULL;
+ struct snd_ctl_elem_info *uinfo __free(kfree) =
+ kzalloc(sizeof(*uinfo), GFP_KERNEL);
- uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
if (!uinfo)
return -ENOMEM;
snd_pcm_hw_param_t var, unsigned int best,
int *dir)
{
- struct snd_pcm_hw_params *save __free(kfree) = NULL;
int v;
unsigned int saved_min;
int last = 0;
maxdir = 1;
max--;
}
- save = kmalloc(sizeof(*save), GFP_KERNEL);
+
+ struct snd_pcm_hw_params *save __free(kfree) =
+ kmalloc(sizeof(*save), GFP_KERNEL);
if (save == NULL)
return -ENOMEM;
*save = *params;
saved_min = min;
min = snd_pcm_hw_param_min(pcm, params, var, min, &mindir);
if (min >= 0) {
- struct snd_pcm_hw_params *params1 __free(kfree) = NULL;
if (max < 0)
goto _end;
if ((unsigned int)min == saved_min && mindir == valdir)
goto _end;
- params1 = kmalloc(sizeof(*params1), GFP_KERNEL);
+
+ struct snd_pcm_hw_params *params1 __free(kfree) =
+ kmalloc(sizeof(*params1), GFP_KERNEL);
if (params1 == NULL)
return -ENOMEM;
*params1 = *save;
struct snd_pcm_hw_params *params, unsigned int best_rate)
{
const struct snd_interval *it;
- struct snd_pcm_hw_params *save __free(kfree) = NULL;
unsigned int rate, prev;
- save = kmalloc(sizeof(*save), GFP_KERNEL);
+ struct snd_pcm_hw_params *save __free(kfree) =
+ kmalloc(sizeof(*save), GFP_KERNEL);
if (save == NULL)
return -ENOMEM;
*save = *params;
struct snd_pcm_substream *substream;
int err;
int direct;
- struct snd_pcm_hw_params *params __free(kfree) = NULL;
unsigned int formats = 0;
const struct snd_mask *format_mask;
int fmt;
AFMT_S32_LE | AFMT_S32_BE |
AFMT_S24_LE | AFMT_S24_BE |
AFMT_S24_PACKED;
- params = kmalloc(sizeof(*params), GFP_KERNEL);
+
+ struct snd_pcm_hw_params *params __free(kfree) =
+ kmalloc(sizeof(*params), GFP_KERNEL);
if (!params)
return -ENOMEM;
_snd_pcm_hw_params_any(params);