From: Oleg Drokin Date: Tue, 12 Aug 2014 02:18:29 +0000 (-0400) Subject: staging/lustre/lnet: Fix potential uninitialized variable warning X-Git-Tag: firefly_0821_release~176^2~3121^2~1285 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=459d3236ad453642db3b99817c10a57d7d77faa4;p=firefly-linux-kernel-4.4.55.git staging/lustre/lnet: Fix potential uninitialized variable warning Greg reports that with one of the patches in his queue there's now an unused variable warning in lnet_parse_ip2nets for ipaddrs variable. Apparently the warning is a false positive as in all cases where lnet_ipaddr_enumerate can return without setting ipaddrs to something a negative return value is returned that is then checked before we actually use ipaddrs. Assign ipaddrs to NULL to quiet this. Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index ede664bfb748..af171e25a5ec 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -1172,7 +1172,7 @@ lnet_ipaddr_enumerate(__u32 **ipaddrsp) int lnet_parse_ip2nets(char **networksp, char *ip2nets) { - __u32 *ipaddrs; + __u32 *ipaddrs = NULL; int nip = lnet_ipaddr_enumerate(&ipaddrs); int rc;