Skip to content

Commit

Permalink
ipv6: Use ERR_CAST in addrconf_dst_alloc.
Browse files Browse the repository at this point in the history
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 3, 2011
1 parent a45d49d commit 29546a6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 29546a6

Please sign in to comment.