[1/1] net/sfc: drop redundant null check from IPv4 flow item parse

Message ID 20230713224002.5667-1-ivan.malov@arknetworks.am (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [1/1] net/sfc: drop redundant null check from IPv4 flow item parse |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-unit-testing fail Testing issues
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing warning Testing issues
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Ivan Malov July 13, 2023, 10:40 p.m. UTC
  Such check is already done at an earlier point, in
sfc_flow_parse_pattern(), so remove it from IPv4
item parser. Doing so should fix Coverity issue.

Coverity issue: 395526
Fixes: f79ce621e963 ("net/sfc: support IPv4 fragment matching in transfer rules")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
---
 drivers/net/sfc/sfc_mae.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Andrew Rybchenko July 14, 2023, 5:38 a.m. UTC | #1
On 7/14/23 01:40, Ivan Malov wrote:
> Such check is already done at an earlier point, in
> sfc_flow_parse_pattern(), so remove it from IPv4
> item parser. Doing so should fix Coverity issue.
> 
> Coverity issue: 395526
> Fixes: f79ce621e963 ("net/sfc: support IPv4 fragment matching in transfer rules")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  
Ferruh Yigit July 17, 2023, 1:17 p.m. UTC | #2
On 7/14/2023 6:38 AM, Andrew Rybchenko wrote:
> On 7/14/23 01:40, Ivan Malov wrote:
>> Such check is already done at an earlier point, in
>> sfc_flow_parse_pattern(), so remove it from IPv4
>> item parser. Doing so should fix Coverity issue.
>>
>> Coverity issue: 395526
>> Fixes: f79ce621e963 ("net/sfc: support IPv4 fragment matching in
>> transfer rules")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
> 
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> 

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

Patch

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 63f6536243..60a54fd425 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -2331,7 +2331,7 @@  sfc_mae_rule_parse_item_ipv4(const struct rte_flow_item *item,
 	if (ctx_mae->match_spec != ctx_mae->match_spec_action)
 		supp_mask.hdr.fragment_offset = 0;
 
-	if (item != NULL && item->last != NULL) {
+	if (item->last != NULL) {
 		last = item->last;
 		item_dup.last = NULL;
 	}