Thread (3 messages) 3 messages, 3 authors, 2021-06-03

[PATCH] dmaengine: idxd: Fix missing error code in idxd_cdev_open()

flat view
STALE1957d LANDED

From: Jiapeng Chong <hidden>
Date: 2021-06-02 10:07:43
Also in: lkml
Subsystem: dma generic offload engine subsystem, intel idxd driver, the rest · Maintainers: Vinod Koul, Vinicius Costa Gomes, Linus Torvalds

Landed in mainline as 99b18e88a1cf on 2021-06-03.

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'.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
---
 drivers/dma/idxd/cdev.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c
index 302cba5..d4419bf 100644
--- a/drivers/dma/idxd/cdev.c
+++ b/drivers/dma/idxd/cdev.c
@@ -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;
 		}
 
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help