mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
confd: guard NULL forced PMD in fixed-speed ethtool config
In netdag_gen_ethtool_autoneg() the unmapped and "exactly one entry" checks already guarantee a forced PMD link mode is selected, but Coverity cannot see the correlation and flags the later deref. Fold !forced into the entry-count guard to make the invariant explicit. Fixes Coverity CID 561388. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -237,7 +237,7 @@ static int netdag_gen_ethtool_autoneg(struct dagger *net, struct lyd_node *cif)
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (n != 1) {
|
||||
if (n != 1 || !forced) {
|
||||
sr_session_set_error_message(net->session,
|
||||
"%s: auto-negotiation/enable=false requires exactly one "
|
||||
"advertised-pmd-types entry (have %d)", ifname, n);
|
||||
|
||||
Reference in New Issue
Block a user