ipv6: Use ERR_CAST in addrconf_dst_alloc.

Started by David Miller on Mar 3, 2011

Subsystems (3)

Maintainers (7)

Show 3 more
DORMANTno replies

open the first message on its own page

  1. [PATCH] ipv6: Use ERR_CAST in addrconf_dst_alloc.
    Related patches
Message details and related content
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv6/route.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 053a92e..59f2a58 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2022,12 +2022,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
 	if (IS_ERR(neigh)) {
 		dst_free(&rt->dst);
 
-		/* We are casting this because that is the return
-		 * value type.  But an errno encoded pointer is the
-		 * same regardless of the underlying pointer type,
-		 * and that's what we are returning.  So this is OK.
-		 */
-		return (struct rt6_info *) neigh;
+		return ERR_CAST(neigh);
 	}
 	rt->rt6i_nexthop = neigh;
 
-- 
1.7.4.1
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help