[morimoto:sound-cleanup-2026-04-20 127/127] sound/soc/soc-component.c:1712:18: warning: variable 'card' is uninitialized when used here

kernel test robot
2026-04-21T00:03:05Z

tree: https://github.com/morimoto/linux sound-cleanup-2026-04-20
head: c0eca3aad838fa892c00ca5d3141b136aac51b91
commit: bfa0d5aadb75033c0a6038d125e5e98d4d6311eb [127/127] ASoC: soc-component: move snd_soc_register_[un]component() to soc-component.c
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20260421/202604210755.vDZ5fdMu-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260421/202604210755.vDZ5fdMu-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604210755.vDZ5fdMu-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> sound/soc/soc-component.c:1712:18: warning: variable 'card' is uninitialized when used here [-Wuninitialized]
1712 | soc_card_rebind(card);
| ^~~~
sound/soc/soc-component.c:1684:27: note: initialize the variable 'card' to silence this warning
1684 | struct snd_soc_card *card;
| ^
| = NULL
1 warning generated.

vim +/card +1712 sound/soc/soc-component.c

1679
1680 int snd_soc_component_add(struct snd_soc_component *component,
1681 struct snd_soc_dai_driver *dai_drv,
1682 int num_dai)
1683 {
1684 struct snd_soc_card *card;
1685 int ret;
1686 int i;
1687 guard(mutex)(&client_mutex);
1688
1689 if (component->driver->endianness) {
1690 for (i = 0; i < num_dai; i++) {
1691 convert_endianness_formats(&dai_drv[i].playback);
1692 convert_endianness_formats(&dai_drv[i].capture);
1693 }
1694 }
1695
1696 ret = soc_component_register_dais(component, dai_drv, num_dai);
1697 if (ret < 0) {
1698 dev_err(component->dev, "ASoC: Failed to register DAIs: %d\n",
1699 ret);
1700 goto err_cleanup;
1701 }
1702
1703 if (!component->driver->write && !component->driver->read) {
1704 if (!component->regmap)
1705 component->regmap = dev_get_regmap(component->dev,
1706 NULL);
1707 }
1708
1709 /* see for_each_component */
1710 list_add(&component->list, soc_component_get_list_head());
1711
> 1712 soc_card_rebind(card);
1713
1714 err_cleanup:
1715 if (ret < 0)
1716 snd_soc_component_del(component);
1717
1718 return ret;
1719 }
1720 EXPORT_SYMBOL_GPL(snd_soc_component_add);
1721

--
0-DAY CI Kernel Test Service