Commit 62720b12 authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller

dns: remove redundant zero length namelen check

The zero namelen check is redundant as it has already been checked
for zero at the start of the function.  Remove the redundant check.

Addresses-Coverity: ("Logically Dead Code")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 909620ff
...@@ -94,8 +94,6 @@ int dns_query(const char *type, const char *name, size_t namelen, ...@@ -94,8 +94,6 @@ int dns_query(const char *type, const char *name, size_t namelen,
desclen += typelen + 1; desclen += typelen + 1;
} }
if (!namelen)
namelen = strnlen(name, 256);
if (namelen < 3 || namelen > 255) if (namelen < 3 || namelen > 255)
return -EINVAL; return -EINVAL;
desclen += namelen + 1; desclen += namelen + 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment