[PATCH v1 1/1] net/nbl: fix issues reported by Coverity

Stephen Hemminger stephen at networkplumber.org
Tue Jan 13 15:46:28 CET 2026


On Wed, 29 Oct 2025 20:36:19 -0700
Dimon Zhao <dimon.zhao at nebula-matrix.com> wrote:

> Coverity issue: 490942
> Coverity issue: 490943
> Coverity issue: 490946
> Coverity issue: 490947
> Coverity issue: 490949
> Coverity issue: 490950
> Coverity issue: 490951
> Coverity issue: 490952
> Coverity issue: 490953
> Coverity issue: 490954
> Coverity issue: 490955
> Coverity issue: 490957
> Coverity issue: 490958
> Coverity issue: 490959
> Fixes: a1c5ffa13b2c ("net/nbl: add channel layer")
> Fixes: dc955cd24c8f ("net/nbl: add coexistence mode")
> Fixes: 93b38df5a2ec ("net/nbl: support basic configuration")
> 

Automated code review with AI spotted issue with this patch.
Please address and resubmit.

Patch 5/9: net/nbl: fix issues reported by Coverity

Author: Dimon Zhao
Verdict: ❌ Needs revision - bug introduced
Check	Status
Subject ≤60 chars	✅ (40 chars)
Prefix correct	✅
Coverity issue tags	✅
Fixes tags	✅
Cc: stable at dpdk.org	✅
Signed-off-by	✅

Issues:

    Error - Dead code introduced (lines 41-47 in nbl_userdev.c):

c

   ret = ioctl(common->devfd, NBL_DEV_USER_GET_BAR_SIZE, &bar_size);
   if (ret) {
       NBL_LOG(ERR, "nbl userdev get bar size failed");
       goto close_eventfd;
   }

   if (!ret) {  // <-- ALWAYS TRUE - dead code!

After adding the error check with goto, the subsequent if (!ret) condition can never be false. The if (!ret) block should be removed or restructured.

    Warning (line 53): int ret = 0; - Unnecessary initialization; value is immediately overwritten on line 60.


More information about the dev mailing list