DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/enic: fix dereference before null check
@ 2022-02-14 20:46 John Daley
  2022-02-15 13:01 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: John Daley @ 2022-02-14 20:46 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko; +Cc: dev, John Daley, Hyong Youb Kim

This patch fixes an issue found by coverity. It checks for a possible
null value of "error" before dereferencing it.

CID: 375064: Dereference after null check
Either the check against null is unnecessary, or there may be a null
pointer dereference.

Coverity issue: 375064
Fixes: ee806eea59fe ("net/enic: support GENEVE flow item")

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
---
 drivers/net/enic/enic_fm_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c
index f0bda19a70..c87d3af847 100644
--- a/drivers/net/enic/enic_fm_flow.c
+++ b/drivers/net/enic/enic_fm_flow.c
@@ -1204,7 +1204,7 @@ enic_fm_copy_entry(struct enic_flowman *fm,
 		ret = item_info->copy_item(&args);
 		if (ret) {
 			/* If copy_item set the error, return that */
-			if (error->type != RTE_FLOW_ERROR_TYPE_NONE)
+			if (error && error->type != RTE_FLOW_ERROR_TYPE_NONE)
 				return ret;
 			goto item_not_supported;
 		}
-- 
2.33.1


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

* Re: [PATCH] net/enic: fix dereference before null check
  2022-02-14 20:46 [PATCH] net/enic: fix dereference before null check John Daley
@ 2022-02-15 13:01 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2022-02-15 13:01 UTC (permalink / raw)
  To: John Daley, arybchenko; +Cc: dev, Hyong Youb Kim

On 2/14/2022 8:46 PM, John Daley wrote:
> This patch fixes an issue found by coverity. It checks for a possible
> null value of "error" before dereferencing it.
> 
> CID: 375064: Dereference after null check
> Either the check against null is unnecessary, or there may be a null
> pointer dereference.
> 
> Coverity issue: 375064
> Fixes: ee806eea59fe ("net/enic: support GENEVE flow item")
> 
> Signed-off-by: John Daley <johndale@cisco.com>
> Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>

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

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

end of thread, other threads:[~2022-02-15 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 20:46 [PATCH] net/enic: fix dereference before null check John Daley
2022-02-15 13:01 ` 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).