Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec0e9937 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: core: Drop superfluous error/debug messages after malloc failures



The kernel memory allocators already report the errors when the
requested allocation fails, thus we don't need to warn it again in
each caller side.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 24db8bba
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -217,10 +217,8 @@ static int snd_ctl_new(struct snd_kcontrol **kctl, unsigned int count,
	size += sizeof(struct snd_kcontrol_volatile) * count;

	*kctl = kzalloc(size, GFP_KERNEL);
	if (*kctl == NULL) {
		pr_err("ALSA: Cannot allocate control instance\n");
	if (!*kctl)
		return -ENOMEM;
	}

	for (idx = 0; idx < count; idx++) {
		(*kctl)->vd[idx].access = access;
+1 −3
Original line number Diff line number Diff line
@@ -50,10 +50,8 @@ int snd_device_new(struct snd_card *card, enum snd_device_type type,
	if (snd_BUG_ON(!card || !device_data || !ops))
		return -ENXIO;
	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
	if (dev == NULL) {
		dev_err(card->dev, "Cannot allocate device, type=%d\n", type);
	if (!dev)
		return -ENOMEM;
	}
	INIT_LIST_HEAD(&dev->list);
	dev->card = card;
	dev->type = type;
+1 −3
Original line number Diff line number Diff line
@@ -378,10 +378,8 @@ int snd_hwdep_new(struct snd_card *card, char *id, int device,
	if (rhwdep)
		*rhwdep = NULL;
	hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL);
	if (hwdep == NULL) {
		dev_err(card->dev, "hwdep: cannot allocate\n");
	if (!hwdep)
		return -ENOMEM;
	}

	init_waitqueue_head(&hwdep->open_wait);
	mutex_init(&hwdep->open_mutex);
+1 −3
Original line number Diff line number Diff line
@@ -1212,10 +1212,8 @@ static void snd_mixer_oss_proc_write(struct snd_info_entry *entry,
			/* not changed */
			goto __unlock;
		tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);
		if (! tbl) {
			pr_err("ALSA: mixer_oss: no memory\n");
		if (!tbl)
			goto __unlock;
		}
		tbl->oss_id = ch;
		tbl->name = kstrdup(str, GFP_KERNEL);
		if (! tbl->name) {
+0 −1
Original line number Diff line number Diff line
@@ -854,7 +854,6 @@ static int snd_pcm_oss_change_params(struct snd_pcm_substream *substream)
	params = kmalloc(sizeof(*params), GFP_KERNEL);
	sparams = kmalloc(sizeof(*sparams), GFP_KERNEL);
	if (!sw_params || !params || !sparams) {
		pcm_dbg(substream->pcm, "No memory\n");
		err = -ENOMEM;
		goto failure;
	}
Loading