CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Ranjani Sridharan <[email protected]>
CC: Mark Brown <[email protected]>
CC: "Péter Ujfalusi" <[email protected]>
CC: "Pierre-Louis Bossart" <[email protected]>
CC: Bard Liao <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   5de64d44968e4ae66ebdb0a2d08b443f189d3651
commit: 31cd6e469364c42c9c929750991c51e83a95e80b ASoC: SOF: topology: Add ops 
for setting up and tearing down pipelines
date:   4 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 4 months ago
config: openrisc-randconfig-m041-20220721 
(https://download.01.org/0day-ci/archive/20220727/[email protected]/config)
compiler: or1k-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
sound/soc/sof/topology.c:1780 sof_route_load() warn: missing error code 'ret'

Old smatch warnings:
sound/soc/sof/topology.c:908 sof_control_load() warn: possible memory leak of 
'scontrol'

vim +/ret +1780 sound/soc/sof/topology.c

909dadf21aae8f Ranjani Sridharan     2022-03-14  1742  
311ce4fe7637d9 Liam Girdwood         2019-04-12  1743  /* DAI link - used for 
any driver specific init */
311ce4fe7637d9 Liam Girdwood         2019-04-12  1744  static int 
sof_route_load(struct snd_soc_component *scomp, int index,
311ce4fe7637d9 Liam Girdwood         2019-04-12  1745                     
struct snd_soc_dapm_route *route)
311ce4fe7637d9 Liam Girdwood         2019-04-12  1746  {
311ce4fe7637d9 Liam Girdwood         2019-04-12  1747   struct snd_sof_dev 
*sdev = snd_soc_component_get_drvdata(scomp);
311ce4fe7637d9 Liam Girdwood         2019-04-12  1748   struct snd_sof_widget 
*source_swidget, *sink_swidget;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1749   struct snd_soc_dobj 
*dobj = &route->dobj;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1750   struct snd_sof_route 
*sroute;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1751   int ret = 0;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1752  
311ce4fe7637d9 Liam Girdwood         2019-04-12  1753   /* allocate memory for 
sroute and connect */
311ce4fe7637d9 Liam Girdwood         2019-04-12  1754   sroute = 
kzalloc(sizeof(*sroute), GFP_KERNEL);
311ce4fe7637d9 Liam Girdwood         2019-04-12  1755   if (!sroute)
311ce4fe7637d9 Liam Girdwood         2019-04-12  1756           return -ENOMEM;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1757  
ee1e79b72e3cf5 Ranjani Sridharan     2019-12-04  1758   sroute->scomp = scomp;
ee1e79b72e3cf5 Ranjani Sridharan     2019-12-04  1759   dev_dbg(scomp->dev, 
"sink %s control %s source %s\n",
311ce4fe7637d9 Liam Girdwood         2019-04-12  1760           route->sink, 
route->control ? route->control : "none",
311ce4fe7637d9 Liam Girdwood         2019-04-12  1761           route->source);
311ce4fe7637d9 Liam Girdwood         2019-04-12  1762  
311ce4fe7637d9 Liam Girdwood         2019-04-12  1763   /* source component */
ee1e79b72e3cf5 Ranjani Sridharan     2019-12-04  1764   source_swidget = 
snd_sof_find_swidget(scomp, (char *)route->source);
311ce4fe7637d9 Liam Girdwood         2019-04-12  1765   if (!source_swidget) {
ee1e79b72e3cf5 Ranjani Sridharan     2019-12-04  1766           
dev_err(scomp->dev, "error: source %s not found\n",
311ce4fe7637d9 Liam Girdwood         2019-04-12  1767                   
route->source);
311ce4fe7637d9 Liam Girdwood         2019-04-12  1768           ret = -EINVAL;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1769           goto err;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1770   }
311ce4fe7637d9 Liam Girdwood         2019-04-12  1771  
311ce4fe7637d9 Liam Girdwood         2019-04-12  1772   /*
311ce4fe7637d9 Liam Girdwood         2019-04-12  1773    * Virtual widgets of 
type output/out_drv may be added in topology
311ce4fe7637d9 Liam Girdwood         2019-04-12  1774    * for compatibility. 
These are not handled by the FW.
311ce4fe7637d9 Liam Girdwood         2019-04-12  1775    * So, don't send 
routes whose source/sink widget is of such types
311ce4fe7637d9 Liam Girdwood         2019-04-12  1776    * to the DSP.
311ce4fe7637d9 Liam Girdwood         2019-04-12  1777    */
311ce4fe7637d9 Liam Girdwood         2019-04-12  1778   if (source_swidget->id 
== snd_soc_dapm_out_drv ||
311ce4fe7637d9 Liam Girdwood         2019-04-12  1779       source_swidget->id 
== snd_soc_dapm_output)
311ce4fe7637d9 Liam Girdwood         2019-04-12 @1780           goto err;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1781  
311ce4fe7637d9 Liam Girdwood         2019-04-12  1782   /* sink component */
ee1e79b72e3cf5 Ranjani Sridharan     2019-12-04  1783   sink_swidget = 
snd_sof_find_swidget(scomp, (char *)route->sink);
311ce4fe7637d9 Liam Girdwood         2019-04-12  1784   if (!sink_swidget) {
ee1e79b72e3cf5 Ranjani Sridharan     2019-12-04  1785           
dev_err(scomp->dev, "error: sink %s not found\n",
311ce4fe7637d9 Liam Girdwood         2019-04-12  1786                   
route->sink);
311ce4fe7637d9 Liam Girdwood         2019-04-12  1787           ret = -EINVAL;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1788           goto err;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1789   }
311ce4fe7637d9 Liam Girdwood         2019-04-12  1790  
311ce4fe7637d9 Liam Girdwood         2019-04-12  1791   /*
311ce4fe7637d9 Liam Girdwood         2019-04-12  1792    * Don't send routes 
whose sink widget is of type
311ce4fe7637d9 Liam Girdwood         2019-04-12  1793    * output or out_drv to 
the DSP
311ce4fe7637d9 Liam Girdwood         2019-04-12  1794    */
311ce4fe7637d9 Liam Girdwood         2019-04-12  1795   if (sink_swidget->id == 
snd_soc_dapm_out_drv ||
311ce4fe7637d9 Liam Girdwood         2019-04-12  1796       sink_swidget->id == 
snd_soc_dapm_output)
311ce4fe7637d9 Liam Girdwood         2019-04-12  1797           goto err;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1798  
311ce4fe7637d9 Liam Girdwood         2019-04-12  1799   sroute->route = route;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1800   dobj->private = sroute;
0a2dea1f101067 Ranjani Sridharan     2021-09-27  1801   sroute->src_widget = 
source_swidget;
0a2dea1f101067 Ranjani Sridharan     2021-09-27  1802   sroute->sink_widget = 
sink_swidget;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1803  
311ce4fe7637d9 Liam Girdwood         2019-04-12  1804   /* add route to route 
list */
311ce4fe7637d9 Liam Girdwood         2019-04-12  1805   list_add(&sroute->list, 
&sdev->route_list);
311ce4fe7637d9 Liam Girdwood         2019-04-12  1806  
b9f8e1387cf0c9 Guennadi Liakhovetski 2020-09-17  1807   return 0;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1808  err:
311ce4fe7637d9 Liam Girdwood         2019-04-12  1809   kfree(sroute);
311ce4fe7637d9 Liam Girdwood         2019-04-12  1810   return ret;
311ce4fe7637d9 Liam Girdwood         2019-04-12  1811  }
311ce4fe7637d9 Liam Girdwood         2019-04-12  1812  

:::::: The code at line 1780 was first introduced by commit
:::::: 311ce4fe7637d96608b6e57bf9ebbd8aabcf429e ASoC: SOF: Add support for 
loading topologies

:::::: TO: Liam Girdwood <[email protected]>
:::::: CC: Mark Brown <[email protected]>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to