lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202201310537.vKqvJhx3-lkp@intel.com>
Date:   Mon, 31 Jan 2022 13:48:18 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Hridya Valsaraju <hridya@...gle.com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        GNU/Weeb Mailing List <gwml@...weeb.org>,
        linux-kernel@...r.kernel.org, Todd Kjos <tkjos@...gle.com>
Subject: [ammarfaizi2-block:google/android/kernel/common/android12-5.4
 7700/9999] drivers/dma-buf/dma-buf.c:728 dma_buf_attach() warn: ignoring
 unreachable code.

tree:   https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android12-5.4
head:   57f9b292a6a391387c75515c18f47005fbdaaaf7
commit: e618a51f562f1f038f31b6a4b4a250c062d70eab [7700/9999] ANDROID: Delete the DMA-BUF attachment sysfs statistics
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220131/202201310537.vKqvJhx3-lkp@intel.com/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@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>

smatch warnings:
drivers/dma-buf/dma-buf.c:728 dma_buf_attach() warn: ignoring unreachable code.

vim +728 drivers/dma-buf/dma-buf.c

d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  696  struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  697  					  struct device *dev)
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  698  {
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  699  	struct dma_buf_attachment *attach;
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  700  	int ret;
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  701  
d1aa06a1eaf5f7 drivers/base/dma-buf.c    Laurent Pinchart 2012-01-26  702  	if (WARN_ON(!dmabuf || !dev))
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  703  		return ERR_PTR(-EINVAL);
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  704  
db7942b6292306 drivers/dma-buf/dma-buf.c Markus Elfring   2017-05-08  705  	attach = kzalloc(sizeof(*attach), GFP_KERNEL);
34d84ec4881d13 drivers/dma-buf/dma-buf.c Markus Elfring   2017-05-08  706  	if (!attach)
a9fbc3b73127ef drivers/base/dma-buf.c    Laurent Pinchart 2012-01-26  707  		return ERR_PTR(-ENOMEM);
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  708  
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  709  	attach->dev = dev;
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  710  	attach->dmabuf = dmabuf;
2ed9201bdd9a8e drivers/base/dma-buf.c    Laurent Pinchart 2012-01-26  711  
2ed9201bdd9a8e drivers/base/dma-buf.c    Laurent Pinchart 2012-01-26  712  	mutex_lock(&dmabuf->lock);
2ed9201bdd9a8e drivers/base/dma-buf.c    Laurent Pinchart 2012-01-26  713  
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  714  	if (dmabuf->ops->attach) {
a19741e5e5a9f1 drivers/dma-buf/dma-buf.c Christian König  2018-05-28  715  		ret = dmabuf->ops->attach(dmabuf, attach);
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  716  		if (ret)
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  717  			goto err_attach;
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  718  	}
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  719  	list_add(&attach->node, &dmabuf->attachments);
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  720  
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  721  	return attach;
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  722  
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  723  err_attach:
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  724  	kfree(attach);
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  725  	mutex_unlock(&dmabuf->lock);
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  726  	return ERR_PTR(ret);
                                                                                ^^^^^^^^^^^^^^^^^^^^
The next line is unreachable.

90935b28546d2c drivers/dma-buf/dma-buf.c Hridya Valsaraju 2021-02-01  727  
90935b28546d2c drivers/dma-buf/dma-buf.c Hridya Valsaraju 2021-02-01 @728  	dma_buf_detach(dmabuf, attach);
90935b28546d2c drivers/dma-buf/dma-buf.c Hridya Valsaraju 2021-02-01  729  	return ERR_PTR(ret);
d15bd7ee445d07 drivers/base/dma-buf.c    Sumit Semwal     2011-12-26  730  }

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ