X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fionic%2Fionic_ethdev.c;h=e6207939665ec397832bc595c15fe51560e3f38d;hb=7fbbc981d54fa59fb5f3242d0bf3210e9d23137b;hp=cffe899c078c870ab76128a122890f6149843f7e;hpb=d13d7829fc67d53b007c00546bb0cd9ee3ae2bcb;p=dpdk.git diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index cffe899c07..e620793966 100644 --- 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; + 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); - 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; } /* @@ -1293,4 +1296,4 @@ static struct rte_pci_driver rte_ionic_pmd = { RTE_PMD_REGISTER_PCI(net_ionic, rte_ionic_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ionic, pci_id_ionic_map); RTE_PMD_REGISTER_KMOD_DEP(net_ionic, "* igb_uio | uio_pci_generic | vfio-pci"); -RTE_LOG_REGISTER(ionic_logtype, pmd.net.ionic, NOTICE); +RTE_LOG_REGISTER_DEFAULT(ionic_logtype, NOTICE);