BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Logan Gunthorpe <[email protected]>
CC: Christoph Hellwig <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   aeb6e6ac18c73ec287b3b1e2c913520699358c13
commit: 30280eee2db10ed6f9f2e1b4ec9197465a96b996 iommu/dma: support PCI P2PDMA 
pages in dma-iommu map_sg
date:   2 weeks ago
:::::: branch date: 5 hours ago
:::::: commit date: 2 weeks ago
config: x86_64-randconfig-m001 
(https://download.01.org/0day-ci/archive/20220811/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.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]>

smatch warnings:
drivers/iommu/dma-iommu.c:1340 iommu_dma_unmap_sg() error: uninitialized symbol 
'start'.

vim +/start +1340 drivers/iommu/dma-iommu.c

0db2e5d18f76a6 Robin Murphy      2015-10-01  1292  
06d60728ff5c01 Christoph Hellwig 2019-05-20  1293  static void 
iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
06d60728ff5c01 Christoph Hellwig 2019-05-20  1294               int nents, enum 
dma_data_direction dir, unsigned long attrs)
0db2e5d18f76a6 Robin Murphy      2015-10-01  1295  {
30280eee2db10e Logan Gunthorpe   2022-07-08  1296       dma_addr_t end = 0, 
start;
842fe519f68b4d Robin Murphy      2017-03-31  1297       struct scatterlist *tmp;
842fe519f68b4d Robin Murphy      2017-03-31  1298       int i;
06d60728ff5c01 Christoph Hellwig 2019-05-20  1299  
2e727bffbe9375 David Stevens     2021-09-29  1300       if 
(dev_use_swiotlb(dev)) {
82612d66d51d3b Tom Murphy        2020-11-24  1301               
iommu_dma_unmap_sg_swiotlb(dev, sg, nents, dir, attrs);
82612d66d51d3b Tom Murphy        2020-11-24  1302               return;
82612d66d51d3b Tom Murphy        2020-11-24  1303       }
82612d66d51d3b Tom Murphy        2020-11-24  1304  
ee9d4097cc145d David Stevens     2021-09-29  1305       if (!(attrs & 
DMA_ATTR_SKIP_CPU_SYNC))
ee9d4097cc145d David Stevens     2021-09-29  1306               
iommu_dma_sync_sg_for_cpu(dev, sg, nents, dir);
ee9d4097cc145d David Stevens     2021-09-29  1307  
0db2e5d18f76a6 Robin Murphy      2015-10-01  1308       /*
0db2e5d18f76a6 Robin Murphy      2015-10-01  1309        * The scatterlist 
segments are mapped into a single
30280eee2db10e Logan Gunthorpe   2022-07-08  1310        * contiguous IOVA 
allocation, the start and end points
30280eee2db10e Logan Gunthorpe   2022-07-08  1311        * just have to be 
determined.
0db2e5d18f76a6 Robin Murphy      2015-10-01  1312        */
30280eee2db10e Logan Gunthorpe   2022-07-08  1313       for_each_sg(sg, tmp, 
nents, i) {
30280eee2db10e Logan Gunthorpe   2022-07-08  1314               if 
(sg_is_dma_bus_address(tmp)) {
30280eee2db10e Logan Gunthorpe   2022-07-08  1315                       
sg_dma_unmark_bus_address(tmp);
30280eee2db10e Logan Gunthorpe   2022-07-08  1316                       
continue;
30280eee2db10e Logan Gunthorpe   2022-07-08  1317               }
30280eee2db10e Logan Gunthorpe   2022-07-08  1318  
30280eee2db10e Logan Gunthorpe   2022-07-08  1319               if 
(sg_dma_len(tmp) == 0)
30280eee2db10e Logan Gunthorpe   2022-07-08  1320                       break;
30280eee2db10e Logan Gunthorpe   2022-07-08  1321  
30280eee2db10e Logan Gunthorpe   2022-07-08  1322               start = 
sg_dma_address(tmp);
30280eee2db10e Logan Gunthorpe   2022-07-08  1323               break;
30280eee2db10e Logan Gunthorpe   2022-07-08  1324       }
30280eee2db10e Logan Gunthorpe   2022-07-08  1325  
30280eee2db10e Logan Gunthorpe   2022-07-08  1326       nents -= i;
30280eee2db10e Logan Gunthorpe   2022-07-08  1327       for_each_sg(tmp, tmp, 
nents, i) {
30280eee2db10e Logan Gunthorpe   2022-07-08  1328               if 
(sg_is_dma_bus_address(tmp)) {
30280eee2db10e Logan Gunthorpe   2022-07-08  1329                       
sg_dma_unmark_bus_address(tmp);
30280eee2db10e Logan Gunthorpe   2022-07-08  1330                       
continue;
30280eee2db10e Logan Gunthorpe   2022-07-08  1331               }
30280eee2db10e Logan Gunthorpe   2022-07-08  1332  
842fe519f68b4d Robin Murphy      2017-03-31  1333               if 
(sg_dma_len(tmp) == 0)
842fe519f68b4d Robin Murphy      2017-03-31  1334                       break;
30280eee2db10e Logan Gunthorpe   2022-07-08  1335  
30280eee2db10e Logan Gunthorpe   2022-07-08  1336               end = 
sg_dma_address(tmp) + sg_dma_len(tmp);
842fe519f68b4d Robin Murphy      2017-03-31  1337       }
30280eee2db10e Logan Gunthorpe   2022-07-08  1338  
30280eee2db10e Logan Gunthorpe   2022-07-08  1339       if (end)
b61d271e59d7fd Robin Murphy      2019-05-20 @1340               
__iommu_dma_unmap(dev, start, end - start);
0db2e5d18f76a6 Robin Murphy      2015-10-01  1341  }
0db2e5d18f76a6 Robin Murphy      2015-10-01  1342  

:::::: The code at line 1340 was first introduced by commit
:::::: b61d271e59d7fd679ad9922ce5f16c116c0f8e94 iommu/dma: Move domain lookup 
into __iommu_dma_{map,unmap}

:::::: TO: Robin Murphy <[email protected]>
:::::: CC: Joerg Roedel <[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