All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kuninori.morimoto.gx@renesas.com
Cc: alsa-devel@alsa-project.org
Subject: [bug report] ASoC: rsnd: call missing snd_ctl_remove()
Date: Thu, 15 Dec 2016 12:44:29 +0300	[thread overview]
Message-ID: <20161215094428.GA9010@elgon.mountain> (raw)

Hello Kuninori Morimoto,

The patch d1f83d6ef43b: "ASoC: rsnd: call missing snd_ctl_remove()"
from Feb 2, 2015, leads to the following static checker warning:

	sound/soc/sh/rcar/core.c:1034 __rsnd_kctrl_new()
	error: double free of 'kctrl'

sound/soc/sh/rcar/core.c
  1026          int ret;
  1027  
  1028          kctrl = snd_ctl_new1(&knew, mod);
  1029          if (!kctrl)
  1030                  return -ENOMEM;
  1031  
  1032          ret = snd_ctl_add(card, kctrl);
  1033          if (ret < 0) {
  1034                  snd_ctl_free_one(kctrl);

The snd_ctl_add() function frees kctrl on error.  It's a confusing
layering violation IMHO but there are a lot of callers so I'm too lazy
to clean this up myself...

  1035                  return ret;
  1036          }
  1037  

regards,
dan carpenter

             reply	other threads:[~2016-12-15  9:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15  9:44 Dan Carpenter [this message]
2016-12-15 23:40 ` [bug report] ASoC: rsnd: call missing snd_ctl_remove() Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161215094428.GA9010@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.