|WARNING| net/qede: initialize ptt to prevent derefence
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Fri Nov 13 19:58:43 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172876
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-13
**Error: PTT acquired in the else branch is never released (resource leak)**
```c
+ ptt = ecore_ptt_acquire(ECORE_LEADING_HWFN(edev));
+ if (ptt)
+ ecore_mcp_get_mfw_ver(ECORE_LEADING_HWFN(edev), ptt,
+ &dev_info->mfw_rev, NULL);
}
return 0;
```
The if branch directly above releases its window with `ecore_ptt_release(ECORE_LEADING_HWFN(edev), ptt);` after use. The new else branch acquires a PTT but returns without releasing it. Each call to `qed_fill_dev_info()` on this path permanently consumes a PTT window from the hwfn's pool. Once the pool is exhausted, later `ecore_ptt_acquire()` callers will fail.
Suggested fix: release the window before leaving the branch.
```c
} else {
ptt = ecore_ptt_acquire(ECORE_LEADING_HWFN(edev));
if (ptt != NULL) {
ecore_mcp_get_mfw_ver(ECORE_LEADING_HWFN(edev), ptt,
&dev_info->mfw_rev, NULL);
ecore_ptt_release(ECORE_LEADING_HWFN(edev), ptt);
}
}
```
**Info: implicit pointer comparison**
`if (ptt)` should be written `if (ptt != NULL)` per DPDK style.
Review-Result: ERROR
More information about the test-report
mailing list