All of lore.kernel.org
 help / color / mirror / Atom feed
* [freescale-fslc:pr/284 15241/17564] drivers/remoteproc/remoteproc_core.c:1713 rproc_trigger_recovery() error: uninitialized symbol 'firmware_p'.
@ 2021-03-09 21:31 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-03-09 21:31 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Otavio Salvador <otavio@ossystems.com.br>

Hi Jason,

First bad commit (maybe != root cause):

tree:   https://github.com/Freescale/linux-fslc pr/284
head:   08867468907e4fb0db541529eaeee70eaf81d395
commit: 5bb09de3044acf91e6f8c712c026d5a4bc53b563 [15241/17564] MLK-24874-1: include: uapi: fmd: fix the UAPI_HEADER_TEST/install failure
:::::: branch date: 10 hours ago
:::::: commit date: 4 months ago
config: x86_64-randconfig-m001-20210309 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/remoteproc/remoteproc_core.c:1713 rproc_trigger_recovery() error: uninitialized symbol 'firmware_p'.

Old smatch warnings:
drivers/remoteproc/remoteproc_core.c:1625 rproc_coredump() warn: is 'data' large enough for 'struct elf32_hdr'? 1

vim +/firmware_p +1713 drivers/remoteproc/remoteproc_core.c

2666ca9197e3d3 Sarangdhar Joshi     2018-01-05  1673  
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1674  /**
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1675   * rproc_trigger_recovery() - recover a remoteproc
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1676   * @rproc: the remote processor
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1677   *
56324d7a229486 Anna, Suman          2016-08-12  1678   * The recovery is done by resetting all the virtio devices, that way all the
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1679   * rpmsg drivers will be reseted along with the remote processor making the
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1680   * remoteproc functional again.
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1681   *
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1682   * This function can sleep, so it cannot be called from atomic context.
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1683   */
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1684  int rproc_trigger_recovery(struct rproc *rproc)
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1685  {
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1686  	const struct firmware *firmware_p;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1687  	struct device *dev = &rproc->dev;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1688  	int ret;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1689  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1690  	dev_err(dev, "recovering %s\n", rproc->name);
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1691  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1692  	ret = mutex_lock_interruptible(&rproc->lock);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1693  	if (ret)
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1694  		return ret;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1695  
fcd58037f28bf7 Arnaud Pouliquen     2018-04-10  1696  	ret = rproc_stop(rproc, true);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1697  	if (ret)
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1698  		goto unlock_mutex;
ddf711872c9d2b Bjorn Andersson      2016-08-11  1699  
eb225e1d92f46b Peng Fan             2020-02-19  1700  	if (!rproc->skip_fw_load) {
2666ca9197e3d3 Sarangdhar Joshi     2018-01-05  1701  		/* generate coredump */
2666ca9197e3d3 Sarangdhar Joshi     2018-01-05  1702  		rproc_coredump(rproc);
2666ca9197e3d3 Sarangdhar Joshi     2018-01-05  1703  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1704  		/* load firmware */
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1705  		ret = request_firmware(&firmware_p, rproc->firmware, dev);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1706  		if (ret < 0) {
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1707  			dev_err(dev, "request_firmware failed: %d\n", ret);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1708  			goto unlock_mutex;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1709  		}
eb225e1d92f46b Peng Fan             2020-02-19  1710  	}
ddf711872c9d2b Bjorn Andersson      2016-08-11  1711  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1712  	/* boot the remote processor up again */
7e83cab824a867 Sarangdhar Joshi     2017-05-26 @1713  	ret = rproc_start(rproc, firmware_p);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1714  
eb225e1d92f46b Peng Fan             2020-02-19  1715  	if (!rproc->skip_fw_load)
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1716  		release_firmware(firmware_p);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1717  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1718  unlock_mutex:
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1719  	mutex_unlock(&rproc->lock);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1720  	return ret;
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1721  }
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1722  

:::::: The code at line 1713 was first introduced by commit
:::::: 7e83cab824a86704cdbd7735c19d34e0ce423dc5 remoteproc: Modify recovery path to use rproc_{start,stop}()

:::::: TO: Sarangdhar Joshi <spjoshi@codeaurora.org>
:::::: CC: Bjorn Andersson <bjorn.andersson@linaro.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [freescale-fslc:pr/284 15241/17564] drivers/remoteproc/remoteproc_core.c:1713 rproc_trigger_recovery() error: uninitialized symbol 'firmware_p'.
@ 2021-03-10  8:26 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2021-03-10  8:26 UTC (permalink / raw)
  To: kbuild

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

Hi Jason,

tree:   https://github.com/Freescale/linux-fslc  pr/284
head:   08867468907e4fb0db541529eaeee70eaf81d395
commit: 5bb09de3044acf91e6f8c712c026d5a4bc53b563 [15241/17564] MLK-24874-1: include: uapi: fmd: fix the UAPI_HEADER_TEST/install failure
config: x86_64-randconfig-m001-20210309 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/remoteproc/remoteproc_core.c:1713 rproc_trigger_recovery() error: uninitialized symbol 'firmware_p'.

vim +/firmware_p +1713 drivers/remoteproc/remoteproc_core.c

70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1684  int rproc_trigger_recovery(struct rproc *rproc)
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1685  {
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1686  	const struct firmware *firmware_p;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1687  	struct device *dev = &rproc->dev;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1688  	int ret;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1689  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1690  	dev_err(dev, "recovering %s\n", rproc->name);
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1691  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1692  	ret = mutex_lock_interruptible(&rproc->lock);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1693  	if (ret)
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1694  		return ret;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1695  
fcd58037f28bf7 Arnaud Pouliquen     2018-04-10  1696  	ret = rproc_stop(rproc, true);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1697  	if (ret)
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1698  		goto unlock_mutex;
ddf711872c9d2b Bjorn Andersson      2016-08-11  1699  
eb225e1d92f46b Peng Fan             2020-02-19  1700  	if (!rproc->skip_fw_load) {
2666ca9197e3d3 Sarangdhar Joshi     2018-01-05  1701  		/* generate coredump */
2666ca9197e3d3 Sarangdhar Joshi     2018-01-05  1702  		rproc_coredump(rproc);
2666ca9197e3d3 Sarangdhar Joshi     2018-01-05  1703  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1704  		/* load firmware */
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1705  		ret = request_firmware(&firmware_p, rproc->firmware, dev);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1706  		if (ret < 0) {
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1707  			dev_err(dev, "request_firmware failed: %d\n", ret);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1708  			goto unlock_mutex;
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1709  		}
eb225e1d92f46b Peng Fan             2020-02-19  1710  	}

firmware_p uninitialize on else path.

ddf711872c9d2b Bjorn Andersson      2016-08-11  1711  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1712  	/* boot the remote processor up again */
7e83cab824a867 Sarangdhar Joshi     2017-05-26 @1713  	ret = rproc_start(rproc, firmware_p);

This will trigger a syzbot/UBSan warning even if it doesn't cause a
runtime issue.

7e83cab824a867 Sarangdhar Joshi     2017-05-26  1714  
eb225e1d92f46b Peng Fan             2020-02-19  1715  	if (!rproc->skip_fw_load)
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1716  		release_firmware(firmware_p);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1717  
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1718  unlock_mutex:
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1719  	mutex_unlock(&rproc->lock);
7e83cab824a867 Sarangdhar Joshi     2017-05-26  1720  	return ret;
70b85ef83ce352 Fernando Guzman Lugo 2012-08-30  1721  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org 

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-10  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-09 21:31 [freescale-fslc:pr/284 15241/17564] drivers/remoteproc/remoteproc_core.c:1713 rproc_trigger_recovery() error: uninitialized symbol 'firmware_p' kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-03-10  8:26 Dan Carpenter

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.