[v3,02/19] net/cpfl: avoid calling log (printf) with null
Checks
Commit Message
The log message would always refer to str variable which
is NULL here. Looks like author intended to print original
parameter.
Link: https://pvs-studio.com/en/blog/posts/cpp/1183/
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/intel/cpfl/cpfl_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1580,7 +1580,7 @@ parse_repr(const char *key __rte_unused, const char *value, void *args)
RTE_DIM(eth_da->representor_ports));
done:
if (str == NULL) {
- PMD_DRV_LOG(ERR, "wrong representor format: %s", str);
+ PMD_DRV_LOG(ERR, "wrong representor format: %s", value);
return -1;
}