DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/af_xdp: fix integer handling issues
@ 2023-02-21 11:14 Shibin Koikkara Reeny
  2023-02-21 13:30 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Shibin Koikkara Reeny @ 2023-02-21 11:14 UTC (permalink / raw)
  To: dev, qi.z.zhang, anatoly.burakov, bruce.richardson, john.mcnamara
  Cc: ciara.loftus, Shibin Koikkara Reeny

Fix integer handling issues (NEGATIVE_RETURNS) reported
in coverity scan. Add a check to sock variable if the
value is negative return -1.

Coverity issue: 383245
Fixes: 7fc6ae50369d ("net/af_xdp: support CNI Integration")

Signed-off-by: Shibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 02c874d51e..2a20a6960c 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -1508,6 +1508,8 @@ get_cni_fd(char *if_name)
 
 	memset(&server, 0, sizeof(server));
 	sock = init_uds_sock(&server);
+	if (sock < 0)
+		return -1;
 
 	/* Initiates handshake to CNI send: /connect,hostname */
 	snprintf(request, sizeof(request), "%s,%s", UDS_CONNECT_MSG, hostname);
-- 
2.25.1


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

* Re: [PATCH] net/af_xdp: fix integer handling issues
  2023-02-21 11:14 [PATCH] net/af_xdp: fix integer handling issues Shibin Koikkara Reeny
@ 2023-02-21 13:30 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2023-02-21 13:30 UTC (permalink / raw)
  To: Shibin Koikkara Reeny, dev, qi.z.zhang, anatoly.burakov,
	bruce.richardson, john.mcnamara
  Cc: ciara.loftus

On 2/21/2023 11:14 AM, Shibin Koikkara Reeny wrote:
> Fix integer handling issues (NEGATIVE_RETURNS) reported
> in coverity scan. Add a check to sock variable if the
> value is negative return -1.
> 
> Coverity issue: 383245
> Fixes: 7fc6ae50369d ("net/af_xdp: support CNI Integration")
> 
> Signed-off-by: Shibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>

Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>

Applied to dpdk-next-net/main, thanks.


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

end of thread, other threads:[~2023-02-21 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-21 11:14 [PATCH] net/af_xdp: fix integer handling issues Shibin Koikkara Reeny
2023-02-21 13:30 ` Ferruh Yigit

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