alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: anish kumar <yesanishhere@gmail.com>
Cc: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	kbuild-all@01.org
Subject: [asoc:topic/dapm 4/4] sound//soc/soc-dapm.c:3940:2: warning: 'w_param_text' may be used uninitialized in this function
Date: Fri, 6 Oct 2017 03:59:13 +0800	[thread overview]
Message-ID: <201710060309.6KFxYOQt%fengguang.wu@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4067 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git topic/dapm
head:   19ad683abc8534cd755403381c73c0ddce7b9f6d
commit: 19ad683abc8534cd755403381c73c0ddce7b9f6d [4/4] ASoC: dapm: Avoid creating kcontrol for params
config: i386-randconfig-x079-201740 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout 19ad683abc8534cd755403381c73c0ddce7b9f6d
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   sound//soc/soc-dapm.c: In function 'snd_soc_dapm_new_pcm':
>> sound//soc/soc-dapm.c:3940:2: warning: 'w_param_text' may be used uninitialized in this function [-Wmaybe-uninitialized]
     snd_soc_dapm_free_kcontrol(card, &private_value, num_params, w_param_text);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/w_param_text +3940 sound//soc/soc-dapm.c

  3862	
  3863	int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
  3864				 const struct snd_soc_pcm_stream *params,
  3865				 unsigned int num_params,
  3866				 struct snd_soc_dapm_widget *source,
  3867				 struct snd_soc_dapm_widget *sink)
  3868	{
  3869		struct snd_soc_dapm_widget template;
  3870		struct snd_soc_dapm_widget *w;
  3871		const char **w_param_text;
  3872		unsigned long private_value;
  3873		char *link_name;
  3874		int ret;
  3875	
  3876		link_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-%s",
  3877					   source->name, sink->name);
  3878		if (!link_name)
  3879			return -ENOMEM;
  3880	
  3881		memset(&template, 0, sizeof(template));
  3882		template.reg = SND_SOC_NOPM;
  3883		template.id = snd_soc_dapm_dai_link;
  3884		template.name = link_name;
  3885		template.event = snd_soc_dai_link_event;
  3886		template.event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
  3887			SND_SOC_DAPM_PRE_PMD;
  3888		template.kcontrol_news = NULL;
  3889	
  3890		/* allocate memory for control, only in case of multiple configs */
  3891		if (num_params > 1) {
  3892			w_param_text = devm_kcalloc(card->dev, num_params,
  3893						sizeof(char *), GFP_KERNEL);
  3894			if (!w_param_text) {
  3895				ret = -ENOMEM;
  3896				goto param_fail;
  3897			}
  3898	
  3899			template.num_kcontrols = 1;
  3900			template.kcontrol_news =
  3901						snd_soc_dapm_alloc_kcontrol(card,
  3902							link_name, params, num_params,
  3903							w_param_text, &private_value);
  3904			if (!template.kcontrol_news) {
  3905				ret = -ENOMEM;
  3906				goto param_fail;
  3907			}
  3908		}
  3909		dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name);
  3910	
  3911		w = snd_soc_dapm_new_control_unlocked(&card->dapm, &template);
  3912		if (IS_ERR(w)) {
  3913			ret = PTR_ERR(w);
  3914			/* Do not nag about probe deferrals */
  3915			if (ret != -EPROBE_DEFER)
  3916				dev_err(card->dev,
  3917					"ASoC: Failed to create %s widget (%d)\n",
  3918					link_name, ret);
  3919			goto outfree_kcontrol_news;
  3920		}
  3921		if (!w) {
  3922			dev_err(card->dev, "ASoC: Failed to create %s widget\n",
  3923				link_name);
  3924			ret = -ENOMEM;
  3925			goto outfree_kcontrol_news;
  3926		}
  3927	
  3928		w->params = params;
  3929		w->num_params = num_params;
  3930	
  3931		ret = snd_soc_dapm_add_path(&card->dapm, source, w, NULL, NULL);
  3932		if (ret)
  3933			goto outfree_w;
  3934		return snd_soc_dapm_add_path(&card->dapm, w, sink, NULL, NULL);
  3935	
  3936	outfree_w:
  3937		devm_kfree(card->dev, w);
  3938	outfree_kcontrol_news:
  3939		devm_kfree(card->dev, (void *)template.kcontrol_news);
> 3940		snd_soc_dapm_free_kcontrol(card, &private_value, num_params, w_param_text);
  3941	param_fail:
  3942		devm_kfree(card->dev, link_name);
  3943		return ret;
  3944	}
  3945	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31095 bytes --]

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



                 reply	other threads:[~2017-10-05 20:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201710060309.6KFxYOQt%fengguang.wu@intel.com \
    --to=fengguang.wu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=kbuild-all@01.org \
    --cc=yesanishhere@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).