aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ark
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-07-03 15:11:03 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2017-07-03 15:13:07 +0100
commitbf7567fd2a5b0b28ab724046143c24561d38d015 (patch)
treed3fecf7bb6da55e6ee81f8d42110bd51c6e93631 /drivers/net/ark
parent7595afa4d30097c1177b69257118d8ad89a539be (diff)
New upstream version 17.05.1
Change-Id: I8a23679edd6c9c593ceebecf7d2bf1b489e14ccb Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/net/ark')
-rw-r--r--drivers/net/ark/ark_ethdev.c18
-rw-r--r--drivers/net/ark/ark_pktchkr.c2
-rw-r--r--drivers/net/ark/ark_pktgen.c2
3 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 995c93d3..017817e2 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -516,11 +516,7 @@ eth_ark_dev_uninit(struct rte_eth_dev *dev)
dev->dev_ops = NULL;
dev->rx_pkt_burst = NULL;
dev->tx_pkt_burst = NULL;
- if (dev->data->mac_addrs)
- rte_free(dev->data->mac_addrs);
- if (dev->data)
- rte_free(dev->data);
-
+ rte_free(dev->data->mac_addrs);
return 0;
}
@@ -588,7 +584,11 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
/* Delay packet generatpr start allow the hardware to be ready
* This is only used for sanity checking with internal generator
*/
- pthread_create(&thread, NULL, delay_pg_start, ark);
+ if (pthread_create(&thread, NULL, delay_pg_start, ark)) {
+ PMD_DRV_LOG(ERR, "Could not create pktgen "
+ "starter thread\n");
+ return -1;
+ }
}
if (ark->user_ext.dev_start)
@@ -899,6 +899,12 @@ process_file_args(const char *key, const char *value, void *extra_args)
int size = 0;
int first = 1;
+ if (file == NULL) {
+ PMD_DRV_LOG(ERR, "Unable to open "
+ "config file %s\n", value);
+ return -1;
+ }
+
while (fgets(line, sizeof(line), file)) {
size += strlen(line);
if (size >= ARK_MAX_ARG_LEN) {
diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c
index 62b3673b..c3040af3 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/net/ark/ark_pktchkr.c
@@ -372,7 +372,7 @@ set_arg(char *arg, char *val)
o->v.INT = atoll(val);
break;
case OTSTRING:
- strncpy(o->v.STR, val, ARK_MAX_STR_LEN);
+ snprintf(o->v.STR, ARK_MAX_STR_LEN, "%s", val);
break;
}
return 1;
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c
index bdac054e..8c7a8a2d 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/net/ark/ark_pktgen.c
@@ -354,7 +354,7 @@ pmd_set_arg(char *arg, char *val)
o->v.INT = atoll(val);
break;
case OTSTRING:
- strncpy(o->v.STR, val, ARK_MAX_STR_LEN);
+ snprintf(o->v.STR, ARK_MAX_STR_LEN, "%s", val);
break;
}
return 1;