Skip to contentSkip to conversation

dmaengine: idxd: Fix missing error code in idxd_cdev_open()

PATCH Applied Jiapeng Chong 3 participants 3 messages Jun 2, 2021 – Jun 3, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: idxd: Fix missing error code in idxd_cdev_open()

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'rc'.

Eliminate the follow smatch warning:

drivers/dma/idxd/cdev.c:113 idxd_cdev_open() warn: missing error code 'rc'.

---
 drivers/dma/idxd/cdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/idxd/cdev.c +1 -0
index 302cba5..d4419bf 100644
@@ -110,6 +110,7 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp)
 		pasid = iommu_sva_get_pasid(sva);
 		if (pasid == IOMMU_PASID_INVALID) {
 			iommu_sva_unbind_device(sva);
+			rc = -EINVAL;
 			goto failed;
 		}
 
Signature · 1 line
1.8.3.1
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jiapeng Chong

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'rc'.

Eliminate the follow smatch warning:

drivers/dma/idxd/cdev.c:113 idxd_cdev_open() warn: missing error code 'rc'.

Quoted 16 lines
---
  drivers/dma/idxd/cdev.c | 1 +
  1 file changed, 1 insertion(+)
drivers/dma/idxd/cdev.c +1 -0
index 302cba5..d4419bf 100644
@@ -110,6 +110,7 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp)
  		pasid = iommu_sva_get_pasid(sva);
  		if (pasid == IOMMU_PASID_INVALID) {
  			iommu_sva_unbind_device(sva);
+			rc = -EINVAL;
  			goto failed;
  		}
 
maintainer Applied
#2 lore raw
In reply to Jiapeng Chong
Quoted 7 lines · Jiapeng Chong

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'rc'.

Eliminate the follow smatch warning:

drivers/dma/idxd/cdev.c:113 idxd_cdev_open() warn: missing error code 'rc'.

Applied, thanks

Signature · 1 line
~Vinod