nvme: optimise io_uring passthrough completion
[linux-block.git] / lib / net_utils.c
index af525353395d679001d98f73d1411e2d0dbbecda..c17201df3d08142bfc0e64b5903d0838afa710bf 100644 (file)
@@ -6,10 +6,11 @@
 
 bool mac_pton(const char *s, u8 *mac)
 {
+       size_t maxlen = 3 * ETH_ALEN - 1;
        int i;
 
        /* XX:XX:XX:XX:XX:XX */
-       if (strlen(s) < 3 * ETH_ALEN - 1)
+       if (strnlen(s, maxlen) < maxlen)
                return false;
 
        /* Don't dirty result unless string is valid MAC. */