|WARNING| net/ice: fix NULL dereference on ACL init failure
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Fri Nov 6 08:30:42 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172689
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-06
# DPDK Patch Review
## Summary
This patch fixes a NULL pointer dereference in the ice driver's ACL cleanup path.
---
## ERRORS
None.
---
## WARNINGS
**1. Missing `hw->acl_prof` NULL assignment after free operations**
The patch prevents the NULL dereference, but the existing code in `ice_acl_prof_free()` frees individual profile entries without NULLing them or the parent array pointer. This leaves dangling pointers that could cause use-after-free if the function is called twice.
**Location:** `drivers/net/intel/ice/ice_acl_filter.c:1072-1074`
```c
for (ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
ptype < ICE_FLTR_PTYPE_MAX; ptype++) {
ice_free(hw, hw->acl_prof[ptype]);
```
**Suggested fix:**
```c
for (ptype = ICE_FLTR_PTYPE_NONF_NONE + 1;
ptype < ICE_FLTR_PTYPE_MAX; ptype++) {
ice_free(hw, hw->acl_prof[ptype]);
hw->acl_prof[ptype] = NULL;
}
ice_free(hw, hw->acl_prof);
hw->acl_prof = NULL;
```
This prevents double-free and makes the function idempotent - it can safely be called multiple times on the same `hw` structure.
---
## INFO
**1. Consider checking and documenting the init/uninit contract**
The fix addresses the symptom (NULL dereference) but the root issue is that the cleanup function is called even when initialization was never completed. Review whether `ice_flow_uninit()` should track initialization state to avoid calling cleanup for components that never initialized successfully.
---
Review-Result: WARNING
More information about the test-report
mailing list