net/hns3: fix max packet size rollback in PF
[dpdk.git] / app / test-pmd / cmdline_flow.c
index 5c2bba4..bbaf18d 100644 (file)
@@ -7702,8 +7702,8 @@ error:
 static int
 parse_hex_string(const char *src, uint8_t *dst, uint32_t *size)
 {
-       uint32_t left = *size;
        const uint8_t *head = dst;
+       uint32_t left;
 
        /* Check input parameters */
        if ((src == NULL) ||
@@ -7712,6 +7712,8 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size)
                (*size == 0))
                return -1;
 
+       left = *size;
+
        /* Convert chars to bytes */
        while (left) {
                char tmp[3], *end = tmp;