We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 497158a commit 4cd482cCopy full SHA for 4cd482c
drivers/infiniband/core/addr.c
@@ -550,18 +550,13 @@ static int addr_resolve(struct sockaddr *src_in,
550
dst_release(dst);
551
}
552
553
- if (ndev->flags & IFF_LOOPBACK) {
554
- ret = rdma_translate_ip(dst_in, addr);
555
- /*
556
- * Put the loopback device and get the translated
557
- * device instead.
558
- */
+ if (ndev) {
+ if (ndev->flags & IFF_LOOPBACK)
+ ret = rdma_translate_ip(dst_in, addr);
+ else
+ addr->bound_dev_if = ndev->ifindex;
559
dev_put(ndev);
560
- ndev = dev_get_by_index(addr->net, addr->bound_dev_if);
561
- } else {
562
- addr->bound_dev_if = ndev->ifindex;
563
564
- dev_put(ndev);
565
566
return ret;
567
0 commit comments