From: Colin Ian King Date: Tue, 9 Apr 2019 12:59:12 +0000 (+0100) Subject: dns: remove redundant zero length namelen check X-Git-Tag: v5.4-rc1~1056^2~195 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62720b12d20aecebc2e74642c37a3dc84717ac7a;p=platform%2Fkernel%2Flinux-rpi.git 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: Colin Ian King Signed-off-by: David S. Miller --- diff --git a/net/dns_resolver/dns_query.c b/net/dns_resolver/dns_query.c index 76338c38738a..19aa32fc1802 100644 --- a/net/dns_resolver/dns_query.c +++ b/net/dns_resolver/dns_query.c @@ -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;