summaryrefslogtreecommitdiffstats
path: root/kernel/include/rdma/ib_addr.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/rdma/ib_addr.h')
-rw-r--r--kernel/include/rdma/ib_addr.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/include/rdma/ib_addr.h b/kernel/include/rdma/ib_addr.h
index 11528591d..a78ff97eb 100644
--- a/kernel/include/rdma/ib_addr.h
+++ b/kernel/include/rdma/ib_addr.h
@@ -197,10 +197,12 @@ static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr,
dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if);
if (dev) {
- ip4 = (struct in_device *)dev->ip_ptr;
- if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address)
+ ip4 = in_dev_get(dev);
+ if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) {
ipv6_addr_set_v4mapped(ip4->ifa_list->ifa_address,
(struct in6_addr *)gid);
+ in_dev_put(ip4);
+ }
dev_put(dev);
}
}