From: Igor Mammedov Date: Tue, 20 May 2008 09:02:01 +0000 (+0400) Subject: Fix possible access to undefined memory region. X-Git-Tag: v2.6.26-rc4~89^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5651ced3ab196b5e7dc485c5777f210aa41e2d8d;p=linux-2.6 Fix possible access to undefined memory region. Signed-off-by: Igor Mammedov Signed-off-by: Steve French --- diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c index 939e256f84..f730ef3549 100644 --- a/fs/cifs/dns_resolve.c +++ b/fs/cifs/dns_resolve.c @@ -134,10 +134,6 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) rkey = request_key(&key_type_dns_resolver, name, ""); if (!IS_ERR(rkey)) { data = rkey->payload.data; - cFYI(1, ("%s: resolved: %s to %s", __func__, - rkey->description, - *ip_addr - )); } else { cERROR(1, ("%s: unable to resolve: %s", __func__, name)); goto out; @@ -150,6 +146,11 @@ skip_upcall: if (*ip_addr) { memcpy(*ip_addr, data, len); (*ip_addr)[len] = '\0'; + if (!IS_ERR(rkey)) + cFYI(1, ("%s: resolved: %s to %s", __func__, + name, + *ip_addr + )); rc = 0; } else { rc = -ENOMEM;