git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/virtio: fix vectorized Rx queue rearm
[dpdk.git]
/
drivers
/
net
/
ionic
/
ionic_ethdev.c
diff --git
a/drivers/net/ionic/ionic_ethdev.c
b/drivers/net/ionic/ionic_ethdev.c
index
cffe899
..
5ec474d
100644
(file)
--- a/
drivers/net/ionic/ionic_ethdev.c
+++ b/
drivers/net/ionic/ionic_ethdev.c
@@
-215,15
+215,18
@@
ionic_dev_fw_version_get(struct rte_eth_dev *eth_dev,
{
struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
struct ionic_adapter *adapter = lif->adapter;
{
struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
struct ionic_adapter *adapter = lif->adapter;
+ int ret;
- if (fw_version == NULL || fw_size <= 0)
- return -EINVAL;
-
- snprintf(fw_version, fw_size, "%s",
+ ret = snprintf(fw_version, fw_size, "%s",
adapter->fw_version);
adapter->fw_version);
- fw_version[fw_size - 1] = '\0';
+ if (ret < 0)
+ return -EINVAL;
- return 0;
+ ret += 1; /* add the size of '\0' */
+ if (fw_size < (size_t)ret)
+ return ret;
+ else
+ return 0;
}
/*
}
/*