drivers/remoteproc/remoteproc_cdev.c:167:6-16: ERROR: reference preceded by free on line 165 (fwd)
PATCH 16/18 drivers/remoteproc/remoteproc_cdev.c:167:6-16: ERROR: reference preceded by free on line 165 (fwd)
Please check lines 165 and 167.
julia
---------- Forwarded message ----------
Date: Mon, 15 Apr 2024 01:28:32 +0800
From: kernel test robot <[email protected]>
To: [email protected]
Cc: [email protected], Julia Lawall <[email protected]>
Subject: [ti:ti-linux-6.6.y-wip 16/18]
drivers/remoteproc/remoteproc_cdev.c:167:6-16: ERROR: reference preceded by free on line 165
BCC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Andrew Davis <[email protected]>
CC: Praneeth Bajjuri <[email protected]>
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-6.6.y-wip head: 6b3bec4539bd706892be36c3b481b9aa7cbe27a8 commit: cde91a89becee656867b8c8a86e627241dc91449 [16/18] remoteproc: core: Add DMA-BUF attachment interface to cdev
:::::: branch date: 3 days ago
:::::: commit date: 2 weeks ago
config: x86_64-randconfig-101-20240414 (https://download.01.org/0day-ci/archive/20240415/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
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 <[email protected]> | Reported-by: Julia Lawall <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/
cocci warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/remoteproc/remoteproc_cdev.c:167:6-16: ERROR: reference preceded by free on line 165
vim +167 drivers/remoteproc/remoteproc_cdev.c
a4dac51a55b795 Andrew Davis 2024-02-21 150
a4dac51a55b795 Andrew Davis 2024-02-21 151 static int rproc_cdev_release(struct inode *inode, struct file *filp)
a4dac51a55b795 Andrew Davis 2024-02-21 152 {
a4dac51a55b795 Andrew Davis 2024-02-21 153 struct rproc_cdev *rproc_cdev = filp->private_data;
a4dac51a55b795 Andrew Davis 2024-02-21 154 struct rproc *rproc = rproc_cdev->rproc;
6e71d2b2a2b717 Mathieu Poirier 2021-03-12 155 int ret = 0;
6e71d2b2a2b717 Mathieu Poirier 2021-03-12 156
cde91a89becee6 Andrew Davis 2024-02-21 157 /* Release all buffers attached with this file */
cde91a89becee6 Andrew Davis 2024-02-21 158 struct rproc_cdev_attach *attach, *atmp;
cde91a89becee6 Andrew Davis 2024-02-21 159 list_for_each_entry_safe(attach, atmp, &rproc_cdev->attachments, node) {
cde91a89becee6 Andrew Davis 2024-02-21 160 rproc_detach_dmabuf(rproc, attach->dmabuf);
cde91a89becee6 Andrew Davis 2024-02-21 161 dma_buf_put(attach->dmabuf);
cde91a89becee6 Andrew Davis 2024-02-21 162 kfree(attach);
cde91a89becee6 Andrew Davis 2024-02-21 163 }
cde91a89becee6 Andrew Davis 2024-02-21 164 mutex_destroy(&rproc_cdev->mutex);
cde91a89becee6 Andrew Davis 2024-02-21 @165 kfree(rproc_cdev);
cde91a89becee6 Andrew Davis 2024-02-21 166
a4dac51a55b795 Andrew Davis 2024-02-21 @167 if (!rproc_cdev->cdev_put_on_release)
6e71d2b2a2b717 Mathieu Poirier 2021-03-12 168 return 0;
4476770881d7ac Siddharth Gupta 2020-07-29 169
6e71d2b2a2b717 Mathieu Poirier 2021-03-12 170 if (rproc->state == RPROC_RUNNING)
4476770881d7ac Siddharth Gupta 2020-07-29 171 rproc_shutdown(rproc);
6e71d2b2a2b717 Mathieu Poirier 2021-03-12 172 else if (rproc->state == RPROC_ATTACHED)
6e71d2b2a2b717 Mathieu Poirier 2021-03-12 173 ret = rproc_detach(rproc);
4476770881d7ac Siddharth Gupta 2020-07-29 174
6e71d2b2a2b717 Mathieu Poirier 2021-03-12 175 return ret;
4476770881d7ac Siddharth Gupta 2020-07-29 176 }
4476770881d7ac Siddharth Gupta 2020-07-29 177:::::: The code at line 167 was first introduced by commit
:::::: a4dac51a55b7950e8e3fdd71db15b8c1686a8a28 remoteproc: core: Make shutdown-on-release per-file handle
:::::: TO: Andrew Davis <[email protected]>
:::::: CC: Praneeth Bajjuri <[email protected]>
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki