All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/mmc/host/davinci_mmc.c:1230 davinci_mmcsd_probe() warn: missing error code 'ret'
Date: Fri, 25 Jun 2021 21:20:37 +0800	[thread overview]
Message-ID: <202106252127.NllcdtAI-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Krzysztof Kozlowski <krzk@kernel.org>
CC: Ulf Hansson <ulf.hansson@linaro.org>

Hi Krzysztof,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   44db63d1ad8d71c6932cbe007eb41f31c434d140
commit: 54d8454436a205682bd89d66d8d9eedbc8452d15 mmc: host: Enable compile testing of multiple drivers
date:   10 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 10 months ago
config: parisc-randconfig-m031-20210625 (attached as .config)
compiler: hppa-linux-gcc (GCC) 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/mmc/host/davinci_mmc.c:1230 davinci_mmcsd_probe() warn: missing error code 'ret'
drivers/mmc/host/moxart-mmc.c:591 moxart_probe() warn: missing error code 'ret'

Old smatch warnings:
drivers/mmc/host/davinci_mmc.c:939 mmc_davinci_irq() error: we previously assumed 'data' could be null (see line 922)
drivers/mmc/host/moxart-mmc.c:692 moxart_remove() warn: variable dereferenced before check 'mmc' (see line 688)

vim +/ret +1230 drivers/mmc/host/davinci_mmc.c

7b43da4cfdd5e8 Manjunathappa, Prakash 2013-03-28  1189  
6478f4e12b7663 David Lechner          2018-01-21  1190  static int davinci_mmcsd_probe(struct platform_device *pdev)
7b43da4cfdd5e8 Manjunathappa, Prakash 2013-03-28  1191  {
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1192  	const struct of_device_id *match;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1193  	struct mmc_davinci_host *host = NULL;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1194  	struct mmc_host *mmc = NULL;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1195  	struct resource *r, *mem = NULL;
62ac52b2fbcc80 David Lechner          2016-04-05  1196  	int ret, irq;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1197  	size_t mem_size;
d7ca4c755a82ed Manjunathappa, Prakash 2013-03-28  1198  	const struct platform_device_id *id_entry;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1199  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1200  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
902a8a0b50d7d1 Arnd Bergmann          2016-09-06  1201  	if (!r)
62ac52b2fbcc80 David Lechner          2016-04-05  1202  		return -ENODEV;
902a8a0b50d7d1 Arnd Bergmann          2016-09-06  1203  	irq = platform_get_irq(pdev, 0);
902a8a0b50d7d1 Arnd Bergmann          2016-09-06  1204  	if (irq < 0)
902a8a0b50d7d1 Arnd Bergmann          2016-09-06  1205  		return irq;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1206  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1207  	mem_size = resource_size(r);
62ac52b2fbcc80 David Lechner          2016-04-05  1208  	mem = devm_request_mem_region(&pdev->dev, r->start, mem_size,
62ac52b2fbcc80 David Lechner          2016-04-05  1209  				      pdev->name);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1210  	if (!mem)
62ac52b2fbcc80 David Lechner          2016-04-05  1211  		return -EBUSY;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1212  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1213  	mmc = mmc_alloc_host(sizeof(struct mmc_davinci_host), &pdev->dev);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1214  	if (!mmc)
62ac52b2fbcc80 David Lechner          2016-04-05  1215  		return -ENOMEM;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1216  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1217  	host = mmc_priv(mmc);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1218  	host->mmc = mmc;	/* Important */
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1219  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1220  	host->mem_res = mem;
62ac52b2fbcc80 David Lechner          2016-04-05  1221  	host->base = devm_ioremap(&pdev->dev, mem->start, mem_size);
62ac52b2fbcc80 David Lechner          2016-04-05  1222  	if (!host->base) {
62ac52b2fbcc80 David Lechner          2016-04-05  1223  		ret = -ENOMEM;
62ac52b2fbcc80 David Lechner          2016-04-05  1224  		goto ioremap_fail;
62ac52b2fbcc80 David Lechner          2016-04-05  1225  	}
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1226  
62ac52b2fbcc80 David Lechner          2016-04-05  1227  	host->clk = devm_clk_get(&pdev->dev, NULL);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1228  	if (IS_ERR(host->clk)) {
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1229  		ret = PTR_ERR(host->clk);
62ac52b2fbcc80 David Lechner          2016-04-05 @1230  		goto clk_get_fail;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1231  	}
e2f3bfbdc9f492 David Lechner          2016-04-05  1232  	ret = clk_prepare_enable(host->clk);
62ac52b2fbcc80 David Lechner          2016-04-05  1233  	if (ret)
e2f3bfbdc9f492 David Lechner          2016-04-05  1234  		goto clk_prepare_enable_fail;
62ac52b2fbcc80 David Lechner          2016-04-05  1235  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1236  	host->mmc_input_clk = clk_get_rate(host->clk);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1237  
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1238  	match = of_match_device(davinci_mmc_dt_ids, &pdev->dev);
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1239  	if (match) {
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1240  		pdev->id_entry = match->data;
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1241  		ret = mmc_of_parse(mmc);
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1242  		if (ret) {
3a35e7e1bd50f7 Krzysztof Kozlowski    2020-09-02  1243  			dev_err_probe(&pdev->dev, ret,
3a35e7e1bd50f7 Krzysztof Kozlowski    2020-09-02  1244  				      "could not parse of data\n");
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1245  			goto parse_fail;
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1246  		}
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1247  	} else {
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1248  		ret = mmc_davinci_parse_pdata(mmc);
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1249  		if (ret) {
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1250  			dev_err(&pdev->dev,
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1251  				"could not parse platform data: %d\n", ret);
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1252  			goto parse_fail;
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1253  	}	}
ca2afb6dbea74e Sudhakar Rajashekhara  2010-05-26  1254  
ca2afb6dbea74e Sudhakar Rajashekhara  2010-05-26  1255  	if (host->nr_sg > MAX_NR_SG || !host->nr_sg)
ca2afb6dbea74e Sudhakar Rajashekhara  2010-05-26  1256  		host->nr_sg = MAX_NR_SG;
ca2afb6dbea74e Sudhakar Rajashekhara  2010-05-26  1257  
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1258  	init_mmcsd_host(host);
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1259  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1260  	host->use_dma = use_dma;
f9db92cb8084c7 Alagu Sankar           2011-01-03  1261  	host->mmc_irq = irq;
f9db92cb8084c7 Alagu Sankar           2011-01-03  1262  	host->sdio_irq = platform_get_irq(pdev, 1);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1263  
0a4d7236c5852f Peter Ujfalusi         2016-03-16  1264  	if (host->use_dma) {
0a4d7236c5852f Peter Ujfalusi         2016-03-16  1265  		ret = davinci_acquire_dma_channels(host);
0a4d7236c5852f Peter Ujfalusi         2016-03-16  1266  		if (ret == -EPROBE_DEFER)
62ac52b2fbcc80 David Lechner          2016-04-05  1267  			goto dma_probe_defer;
0a4d7236c5852f Peter Ujfalusi         2016-03-16  1268  		else if (ret)
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1269  			host->use_dma = 0;
0a4d7236c5852f Peter Ujfalusi         2016-03-16  1270  	}
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1271  
132f10746c2bb2 Vipin Bhandari         2010-03-05  1272  	mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1273  
d7ca4c755a82ed Manjunathappa, Prakash 2013-03-28  1274  	id_entry = platform_get_device_id(pdev);
d7ca4c755a82ed Manjunathappa, Prakash 2013-03-28  1275  	if (id_entry)
d7ca4c755a82ed Manjunathappa, Prakash 2013-03-28  1276  		host->version = id_entry->driver_data;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1277  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1278  	mmc->ops = &mmc_davinci_ops;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1279  	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1280  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1281  	/* With no iommu coalescing pages, each phys_seg is a hw_seg.
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1282  	 * Each hw_seg uses one EDMA parameter RAM slot, always one
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1283  	 * channel and then usually some linked slots.
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1284  	 */
5413da811fbb11 Matt Porter            2012-08-23  1285  	mmc->max_segs		= MAX_NR_SG;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1286  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1287  	/* EDMA limit per hw segment (one or two MBytes) */
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1288  	mmc->max_seg_size	= MAX_CCNT * rw_threshold;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1289  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1290  	/* MMC/SD controller limits for multiblock requests */
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1291  	mmc->max_blk_size	= 4095;  /* BLEN is 12 bits */
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1292  	mmc->max_blk_count	= 65535; /* NBLK is 16 bits */
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1293  	mmc->max_req_size	= mmc->max_blk_size * mmc->max_blk_count;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1294  
a36274e0184193 Martin K. Petersen     2010-09-10  1295  	dev_dbg(mmc_dev(host->mmc), "max_segs=%d\n", mmc->max_segs);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1296  	dev_dbg(mmc_dev(host->mmc), "max_blk_size=%d\n", mmc->max_blk_size);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1297  	dev_dbg(mmc_dev(host->mmc), "max_req_size=%d\n", mmc->max_req_size);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1298  	dev_dbg(mmc_dev(host->mmc), "max_seg_size=%d\n", mmc->max_seg_size);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1299  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1300  	platform_set_drvdata(pdev, host);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1301  
7e30b8decbb1a5 Chaithrika U S         2009-12-14  1302  	ret = mmc_davinci_cpufreq_register(host);
7e30b8decbb1a5 Chaithrika U S         2009-12-14  1303  	if (ret) {
7e30b8decbb1a5 Chaithrika U S         2009-12-14  1304  		dev_err(&pdev->dev, "failed to register cpufreq\n");
7e30b8decbb1a5 Chaithrika U S         2009-12-14  1305  		goto cpu_freq_fail;
7e30b8decbb1a5 Chaithrika U S         2009-12-14  1306  	}
7e30b8decbb1a5 Chaithrika U S         2009-12-14  1307  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1308  	ret = mmc_add_host(mmc);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1309  	if (ret < 0)
62ac52b2fbcc80 David Lechner          2016-04-05  1310  		goto mmc_add_host_fail;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1311  
62ac52b2fbcc80 David Lechner          2016-04-05  1312  	ret = devm_request_irq(&pdev->dev, irq, mmc_davinci_irq, 0,
62ac52b2fbcc80 David Lechner          2016-04-05  1313  			       mmc_hostname(mmc), host);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1314  	if (ret)
62ac52b2fbcc80 David Lechner          2016-04-05  1315  		goto request_irq_fail;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1316  
f9db92cb8084c7 Alagu Sankar           2011-01-03  1317  	if (host->sdio_irq >= 0) {
62ac52b2fbcc80 David Lechner          2016-04-05  1318  		ret = devm_request_irq(&pdev->dev, host->sdio_irq,
62ac52b2fbcc80 David Lechner          2016-04-05  1319  				       mmc_davinci_sdio_irq, 0,
f9db92cb8084c7 Alagu Sankar           2011-01-03  1320  				       mmc_hostname(mmc), host);
f9db92cb8084c7 Alagu Sankar           2011-01-03  1321  		if (!ret)
f9db92cb8084c7 Alagu Sankar           2011-01-03  1322  			mmc->caps |= MMC_CAP_SDIO_IRQ;
f9db92cb8084c7 Alagu Sankar           2011-01-03  1323  	}
f9db92cb8084c7 Alagu Sankar           2011-01-03  1324  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1325  	rename_region(mem, mmc_hostname(mmc));
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1326  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1327  	dev_info(mmc_dev(host->mmc), "Using %s, %d-bit mode\n",
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1328  		host->use_dma ? "DMA" : "PIO",
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1329  		(mmc->caps & MMC_CAP_4_BIT_DATA) ? 4 : 1);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1330  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1331  	return 0;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1332  
62ac52b2fbcc80 David Lechner          2016-04-05  1333  request_irq_fail:
62ac52b2fbcc80 David Lechner          2016-04-05  1334  	mmc_remove_host(mmc);
62ac52b2fbcc80 David Lechner          2016-04-05  1335  mmc_add_host_fail:
7e30b8decbb1a5 Chaithrika U S         2009-12-14  1336  	mmc_davinci_cpufreq_deregister(host);
7e30b8decbb1a5 Chaithrika U S         2009-12-14  1337  cpu_freq_fail:
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1338  	davinci_release_dma_channels(host);
c8301e798fc83e ahaslam(a)baylibre.com   2016-11-15  1339  parse_fail:
62ac52b2fbcc80 David Lechner          2016-04-05  1340  dma_probe_defer:
e2f3bfbdc9f492 David Lechner          2016-04-05  1341  	clk_disable_unprepare(host->clk);
e2f3bfbdc9f492 David Lechner          2016-04-05  1342  clk_prepare_enable_fail:
62ac52b2fbcc80 David Lechner          2016-04-05  1343  clk_get_fail:
62ac52b2fbcc80 David Lechner          2016-04-05  1344  ioremap_fail:
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1345  	mmc_free_host(mmc);
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1346  
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1347  	return ret;
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1348  }
b4cff4549b7a8c Vipin Bhandari         2009-12-14  1349  

:::::: The code at line 1230 was first introduced by commit
:::::: 62ac52b2fbcc8036d1fd4860b232fef2d554fa4d mmc: davinci: fix unwinding in probe

:::::: TO: David Lechner <david@lechnology.com>
:::::: CC: Ulf Hansson <ulf.hansson@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: 24237 bytes --]

                 reply	other threads:[~2021-06-25 13:20 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=202106252127.NllcdtAI-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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.