}
while (s != NULL) {
- if (strncmp(layers[i].key, s,
- strlen(layers[i].key)) &&
- /* The last layer is free-form.
- * The "driver" key is not required (but accepted).
- */
- i != RTE_DIM(layers) - 1)
+ if (i >= RTE_DIM(layers)) {
+ RTE_LOG(ERR, EAL, "Unrecognized layer %s\n", s);
+ ret = -EINVAL;
+ goto get_out;
+ }
+ /*
+ * The last layer is free-form.
+ * The "driver" key is not required (but accepted).
+ */
+ if (strncmp(layers[i].key, s, strlen(layers[i].key)) &&
+ i != RTE_DIM(layers) - 1)
goto next_layer;
layers[i].str = s;
layers[i].kvlist = rte_kvargs_parse_delim(s, NULL, "/");
if (s != NULL)
s++;
next_layer:
- if (i >= RTE_DIM(layers)) {
- RTE_LOG(ERR, EAL, "Unrecognized layer %s\n", s);
- ret = -EINVAL;
- goto get_out;
- }
i++;
}