* [dpdk-dev] [PATCH] pmd_virtio: Unchecked return value from library
@ 2017-11-13 13:38 SebastianX Basierski
2017-11-13 15:59 ` Tan, Jianfeng
2017-11-14 9:27 ` [dpdk-dev] [PATCH v2] net/virtio-user: fix unchecked return value SebastianX Basierski
0 siblings, 2 replies; 6+ messages in thread
From: SebastianX Basierski @ 2017-11-13 13:38 UTC (permalink / raw)
To: dev; +Cc: SebastianX Basierski, jianfeng.tan, yliu
Report error message if clearing O_NONBLOCK flag will fail,
then return from function.
Coverity issue: 143439
Fixes: ef53b6030039 ("net/virtio-user: support LSC")
Cc: jianfeng.tan@intel.com
Cc: yliu@fridaylinux.org
cc: dev@dpdk.org
Signed-off-by: SebastianX Basierski <sebastianx.basierski@intel.com>
---
drivers/net/virtio/virtio_user_ethdev.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 7be57ce..c1f7a64 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -109,7 +109,11 @@ virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset,
} else {
dev->status |= VIRTIO_NET_S_LINK_UP;
}
- fcntl(dev->vhostfd, F_SETFL, flags & (~O_NONBLOCK));
+ if (fcntl(dev->vhostfd, F_SETFL,
+ flags & ~O_NONBLOCK) == -1) {
+ PMD_DRV_LOG(ERR, "error clearing O_NONBLOCK flag");
+ return;
+ }
}
*(uint16_t *)dst = dev->status;
}
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] pmd_virtio: Unchecked return value from library
2017-11-13 13:38 [dpdk-dev] [PATCH] pmd_virtio: Unchecked return value from library SebastianX Basierski
@ 2017-11-13 15:59 ` Tan, Jianfeng
2017-11-14 9:27 ` [dpdk-dev] [PATCH v2] net/virtio-user: fix unchecked return value SebastianX Basierski
1 sibling, 0 replies; 6+ messages in thread
From: Tan, Jianfeng @ 2017-11-13 15:59 UTC (permalink / raw)
To: SebastianX Basierski, dev; +Cc: yliu
Hi Sebastian,
The title can be refined as:
net/virtio-user: fix unchecked return value
Other than the above comment, it seems good to me.
On 11/13/2017 9:38 PM, SebastianX Basierski wrote:
> Report error message if clearing O_NONBLOCK flag will fail,
> then return from function.
>
> Coverity issue: 143439
>
> Fixes: ef53b6030039 ("net/virtio-user: support LSC")
> Cc: jianfeng.tan@intel.com
> Cc: yliu@fridaylinux.org
> cc: dev@dpdk.org
>
> Signed-off-by: SebastianX Basierski <sebastianx.basierski@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Thank you for the fix.
Thanks,
Jianfeng
> ---
> drivers/net/virtio/virtio_user_ethdev.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
> index 7be57ce..c1f7a64 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -109,7 +109,11 @@ virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset,
> } else {
> dev->status |= VIRTIO_NET_S_LINK_UP;
> }
> - fcntl(dev->vhostfd, F_SETFL, flags & (~O_NONBLOCK));
> + if (fcntl(dev->vhostfd, F_SETFL,
> + flags & ~O_NONBLOCK) == -1) {
> + PMD_DRV_LOG(ERR, "error clearing O_NONBLOCK flag");
> + return;
> + }
> }
> *(uint16_t *)dst = dev->status;
> }
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v2] net/virtio-user: fix unchecked return value
2017-11-13 13:38 [dpdk-dev] [PATCH] pmd_virtio: Unchecked return value from library SebastianX Basierski
2017-11-13 15:59 ` Tan, Jianfeng
@ 2017-11-14 9:27 ` SebastianX Basierski
2017-11-14 9:43 ` Maxime Coquelin
2017-11-14 10:39 ` [dpdk-dev] [PATCH v3] " SebastianX Basierski
1 sibling, 2 replies; 6+ messages in thread
From: SebastianX Basierski @ 2017-11-14 9:27 UTC (permalink / raw)
To: dev; +Cc: SebastianX Basierski, jianfeng.tan, yliu
Report error message if clearing O_NONBLOCK flag will fail,
then return from function.
---
v2:
Patch title changed.
---
Coverity issue: 143439
Fixes: ef53b6030039 ("net/virtio-user: support LSC")
Cc: jianfeng.tan@intel.com
Cc: yliu@fridaylinux.org
cc: dev@dpdk.org
Signed-off-by: SebastianX Basierski <sebastianx.basierski@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
drivers/net/virtio/virtio_user_ethdev.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 7be57ce..c1f7a64 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -109,7 +109,11 @@ virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset,
} else {
dev->status |= VIRTIO_NET_S_LINK_UP;
}
- fcntl(dev->vhostfd, F_SETFL, flags & (~O_NONBLOCK));
+ if (fcntl(dev->vhostfd, F_SETFL,
+ flags & ~O_NONBLOCK) == -1) {
+ PMD_DRV_LOG(ERR, "error clearing O_NONBLOCK flag");
+ return;
+ }
}
*(uint16_t *)dst = dev->status;
}
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/virtio-user: fix unchecked return value
2017-11-14 9:27 ` [dpdk-dev] [PATCH v2] net/virtio-user: fix unchecked return value SebastianX Basierski
@ 2017-11-14 9:43 ` Maxime Coquelin
2017-11-14 10:39 ` [dpdk-dev] [PATCH v3] " SebastianX Basierski
1 sibling, 0 replies; 6+ messages in thread
From: Maxime Coquelin @ 2017-11-14 9:43 UTC (permalink / raw)
To: SebastianX Basierski, dev; +Cc: jianfeng.tan, yliu
Hi Sebastian,
On 11/14/2017 10:27 AM, SebastianX Basierski wrote:
> Report error message if clearing O_NONBLOCK flag will fail,
> then return from function.
>
> ---
> v2:
> Patch title changed.
> ---
^^^^The above note should be placed just before diffstats to be removed
at apply time.
> Coverity issue: 143439
>
> Fixes: ef53b6030039 ("net/virtio-user: support LSC")
> Cc: jianfeng.tan@intel.com
> Cc: yliu@fridaylinux.org
> cc: dev@dpdk.org
>
> Signed-off-by: SebastianX Basierski <sebastianx.basierski@intel.com>
> Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
> ---
Here
> drivers/net/virtio/virtio_user_ethdev.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
> index 7be57ce..c1f7a64 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -109,7 +109,11 @@ virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset,
> } else {
> dev->status |= VIRTIO_NET_S_LINK_UP;
> }
> - fcntl(dev->vhostfd, F_SETFL, flags & (~O_NONBLOCK));
> + if (fcntl(dev->vhostfd, F_SETFL,
> + flags & ~O_NONBLOCK) == -1) {
> + PMD_DRV_LOG(ERR, "error clearing O_NONBLOCK flag");
> + return;
> + }
> }
> *(uint16_t *)dst = dev->status;
> }
>
Other than that:
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v3] net/virtio-user: fix unchecked return value
2017-11-14 9:27 ` [dpdk-dev] [PATCH v2] net/virtio-user: fix unchecked return value SebastianX Basierski
2017-11-14 9:43 ` Maxime Coquelin
@ 2017-11-14 10:39 ` SebastianX Basierski
2018-02-06 20:48 ` Thomas Monjalon
1 sibling, 1 reply; 6+ messages in thread
From: SebastianX Basierski @ 2017-11-14 10:39 UTC (permalink / raw)
To: dev; +Cc: SebastianX Basierski, jianfeng.tan, yliu
Report error message if clearing O_NONBLOCK flag will fail,
then return from function.
Coverity issue: 143439
Fixes: ef53b6030039 ("net/virtio-user: support LSC")
Cc: jianfeng.tan@intel.com
Cc: yliu@fridaylinux.org
cc: dev@dpdk.org
Signed-off-by: SebastianX Basierski <sebastianx.basierski@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
v2:
Patch title changed.
---
drivers/net/virtio/virtio_user_ethdev.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 7be57ce..c1f7a64 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -109,7 +109,11 @@ virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset,
} else {
dev->status |= VIRTIO_NET_S_LINK_UP;
}
- fcntl(dev->vhostfd, F_SETFL, flags & (~O_NONBLOCK));
+ if (fcntl(dev->vhostfd, F_SETFL,
+ flags & ~O_NONBLOCK) == -1) {
+ PMD_DRV_LOG(ERR, "error clearing O_NONBLOCK flag");
+ return;
+ }
}
*(uint16_t *)dst = dev->status;
}
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v3] net/virtio-user: fix unchecked return value
2017-11-14 10:39 ` [dpdk-dev] [PATCH v3] " SebastianX Basierski
@ 2018-02-06 20:48 ` Thomas Monjalon
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2018-02-06 20:48 UTC (permalink / raw)
To: SebastianX Basierski; +Cc: dev, jianfeng.tan, yliu
14/11/2017 11:39, SebastianX Basierski:
> Report error message if clearing O_NONBLOCK flag will fail,
> then return from function.
>
> Coverity issue: 143439
>
> Fixes: ef53b6030039 ("net/virtio-user: support LSC")
> Cc: jianfeng.tan@intel.com
> Cc: yliu@fridaylinux.org
> cc: dev@dpdk.org
>
> Signed-off-by: SebastianX Basierski <sebastianx.basierski@intel.com>
> Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
I don't know why this patch was forgotten in the virtio tree.
Applied, thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-02-06 20:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13 13:38 [dpdk-dev] [PATCH] pmd_virtio: Unchecked return value from library SebastianX Basierski
2017-11-13 15:59 ` Tan, Jianfeng
2017-11-14 9:27 ` [dpdk-dev] [PATCH v2] net/virtio-user: fix unchecked return value SebastianX Basierski
2017-11-14 9:43 ` Maxime Coquelin
2017-11-14 10:39 ` [dpdk-dev] [PATCH v3] " SebastianX Basierski
2018-02-06 20:48 ` Thomas Monjalon
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).