dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: idxd: Fix missing error code in idxd_cdev_open()
@ 2021-06-02 10:07 Jiapeng Chong
  2021-06-02 15:00 ` Dave Jiang
  2021-06-03  6:59 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Jiapeng Chong @ 2021-06-02 10:07 UTC (permalink / raw)
  To: dave.jiang; +Cc: vkoul, dmaengine, linux-kernel, 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'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: idxd: Fix missing error code in idxd_cdev_open()
  2021-06-02 10:07 [PATCH] dmaengine: idxd: Fix missing error code in idxd_cdev_open() Jiapeng Chong
@ 2021-06-02 15:00 ` Dave Jiang
  2021-06-03  6:59 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2021-06-02 15:00 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: vkoul, dmaengine, linux-kernel


On 6/2/2021 3:07 AM, Jiapeng Chong wrote:
> 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 <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Acked-by: Dave Jiang <dave.jiang@intel.com>


> ---
>   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;
>   		}
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: idxd: Fix missing error code in idxd_cdev_open()
  2021-06-02 10:07 [PATCH] dmaengine: idxd: Fix missing error code in idxd_cdev_open() Jiapeng Chong
  2021-06-02 15:00 ` Dave Jiang
@ 2021-06-03  6:59 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2021-06-03  6:59 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: dave.jiang, dmaengine, linux-kernel

On 02-06-21, 18:07, Jiapeng Chong wrote:
> 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

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-03  6:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 10:07 [PATCH] dmaengine: idxd: Fix missing error code in idxd_cdev_open() Jiapeng Chong
2021-06-02 15:00 ` Dave Jiang
2021-06-03  6:59 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).