* [PATCH] intel-iommu: correct the value used for error_setg_errno()
@ 2022-04-01 2:28 Jason Wang
2022-04-01 9:16 ` Peter Maydell
2022-04-01 12:15 ` Peter Xu
0 siblings, 2 replies; 3+ messages in thread
From: Jason Wang @ 2022-04-01 2:28 UTC (permalink / raw)
To: mst, peterx; +Cc: jasowang, qemu-devel
error_setg_errno() expects a normal errno value, not a negated
one, so we should use ENOTSUP instead of -ENOSUP.
Fixes: Coverity CID 1487174
Fixes: ("intel_iommu: support snoop control")
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/i386/intel_iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index c64aa81a83..e05d69a2c0 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3032,7 +3032,7 @@ static int vtd_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu,
/* TODO: add support for VFIO and vhost users */
if (s->snoop_control) {
- error_setg_errno(errp, -ENOTSUP,
+ error_setg_errno(errp, ENOTSUP,
"Snoop Control with vhost or VFIO is not supported");
return -ENOTSUP;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] intel-iommu: correct the value used for error_setg_errno()
2022-04-01 2:28 [PATCH] intel-iommu: correct the value used for error_setg_errno() Jason Wang
@ 2022-04-01 9:16 ` Peter Maydell
2022-04-01 12:15 ` Peter Xu
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2022-04-01 9:16 UTC (permalink / raw)
To: Jason Wang; +Cc: qemu-devel, peterx, mst
On Fri, 1 Apr 2022 at 03:29, Jason Wang <jasowang@redhat.com> wrote:
>
> error_setg_errno() expects a normal errno value, not a negated
> one, so we should use ENOTSUP instead of -ENOSUP.
>
> Fixes: Coverity CID 1487174
> Fixes: ("intel_iommu: support snoop control")
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> hw/i386/intel_iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> index c64aa81a83..e05d69a2c0 100644
> --- a/hw/i386/intel_iommu.c
> +++ b/hw/i386/intel_iommu.c
> @@ -3032,7 +3032,7 @@ static int vtd_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu,
>
> /* TODO: add support for VFIO and vhost users */
> if (s->snoop_control) {
> - error_setg_errno(errp, -ENOTSUP,
> + error_setg_errno(errp, ENOTSUP,
> "Snoop Control with vhost or VFIO is not supported");
> return -ENOTSUP;
> }
> --
> 2.25.1
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] intel-iommu: correct the value used for error_setg_errno()
2022-04-01 2:28 [PATCH] intel-iommu: correct the value used for error_setg_errno() Jason Wang
2022-04-01 9:16 ` Peter Maydell
@ 2022-04-01 12:15 ` Peter Xu
1 sibling, 0 replies; 3+ messages in thread
From: Peter Xu @ 2022-04-01 12:15 UTC (permalink / raw)
To: Jason Wang; +Cc: qemu-devel, mst
On Fri, Apr 01, 2022 at 10:28:24AM +0800, Jason Wang wrote:
> error_setg_errno() expects a normal errno value, not a negated
> one, so we should use ENOTSUP instead of -ENOSUP.
>
> Fixes: Coverity CID 1487174
> Fixes: ("intel_iommu: support snoop control")
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-01 12:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-01 2:28 [PATCH] intel-iommu: correct the value used for error_setg_errno() Jason Wang
2022-04-01 9:16 ` Peter Maydell
2022-04-01 12:15 ` Peter Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.