diff options
Diffstat (limited to 'include/rdma/ib_addr.h')
-rw-r--r-- | include/rdma/ib_addr.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index 4b34c51f859e..b73a14edc85e 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
@@ -205,11 +205,13 @@ static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr, | |||
205 | dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if); | 205 | dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if); |
206 | if (dev) { | 206 | if (dev) { |
207 | ip4 = in_dev_get(dev); | 207 | ip4 = in_dev_get(dev); |
208 | if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) { | 208 | if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) |
209 | ipv6_addr_set_v4mapped(ip4->ifa_list->ifa_address, | 209 | ipv6_addr_set_v4mapped(ip4->ifa_list->ifa_address, |
210 | (struct in6_addr *)gid); | 210 | (struct in6_addr *)gid); |
211 | |||
212 | if (ip4) | ||
211 | in_dev_put(ip4); | 213 | in_dev_put(ip4); |
212 | } | 214 | |
213 | dev_put(dev); | 215 | dev_put(dev); |
214 | } | 216 | } |
215 | } | 217 | } |