Skip to content

Commit

Permalink
dns: remove redundant zero length namelen check
Browse files Browse the repository at this point in the history
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: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Colin Ian King authored and David S. Miller committed Apr 11, 2019
1 parent 909620f commit 62720b1
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/dns_resolver/dns_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ int dns_query(const char *type, const char *name, size_t namelen,
desclen += typelen + 1;
}

if (!namelen)
namelen = strnlen(name, 256);
if (namelen < 3 || namelen > 255)
return -EINVAL;
desclen += namelen + 1;
Expand Down

0 comments on commit 62720b1

Please sign in to comment.