Subject: [PATCH] IPv6: only set err in rawv6_bind() when necessary

From: Brian Haley <[email-masked]>
Date: Tue, 01 Aug 2006 13:06:03 -0400

The variable 'err' is set in rawv6_bind() before the address check fails 
instead of after, moved inside if() statement.

Signed-off-by: Brian Haley <[email-masked]>
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 8a30cd8..072b28b 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -240,10 +240,10 @@ static int rawv6_bind(struct sock *sk, s
 		 */
 		v4addr = LOOPBACK4_IPV6;
 		if (!(addr_type & IPV6_ADDR_MULTICAST))	{
-			err = -EADDRNOTAVAIL;
 			if (!ipv6_chk_addr(&addr->sin6_addr, dev, 0)) {
 				if (dev)
 					dev_put(dev);
+				err = -EADDRNOTAVAIL;
 				goto out;
 			}
 		}