Re: [PATCH v3 3/8] net/nfb: add vdev as alternative device probe method

Stephen Hemminger
2026-01-21T17:41:38Z

On Wed, 21 Jan 2026 18:03:28 +0100
spinler@cesnet.cz wrote:

> + /* Clone non-vdev arguments, result is shorter or equal length */
> + ret = sprintf(dev_params_mod, "%s%s=%s",
> + dev_params_mod == dev_params ? "" : ",",
> + pair->key, pair->value);

AI review raises good point here:

Minor style note: The sprintf() call at line 897-899 uses dev_params_mod both as target and in format string. This is technically undefined behavior in C, though it works in practice. Consider using a separate buffer or snprintf() with proper handling.

Verdict: ⚠️ Minor concern - The sprintf(dev_params_mod, "%s%s=%s", dev_params_mod == dev_params ? "" : ",", ...) pattern is risky. Consider refactoring.