diff options
author | Grant Likely <grant.likely@linaro.org> | 2014-03-04 03:44:10 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2014-03-04 03:44:10 -0500 |
commit | dab2310d9d90eded48625c5382c6a60389bf8ca9 (patch) | |
tree | 9327cc815d69dec23aebf03407e3fa82b6d2fbaa /drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | |
parent | a3dbeb5b45af5b6113385db89fce2a8279278e8b (diff) | |
parent | 0414855fdc4a40da05221fc6062cccbc0c30f169 (diff) |
Merge tag 'v3.14-rc5' into HEAD
Linux 3.14-rc5
Diffstat (limited to 'drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c')
-rw-r--r-- | drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c index 7ecc6061f1f4..f8dfd76be89f 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | |||
@@ -629,6 +629,7 @@ static int qp_grp_id_from_flow(struct usnic_ib_qp_grp_flow *qp_flow, | |||
629 | { | 629 | { |
630 | enum usnic_transport_type trans_type = qp_flow->trans_type; | 630 | enum usnic_transport_type trans_type = qp_flow->trans_type; |
631 | int err; | 631 | int err; |
632 | uint16_t port_num = 0; | ||
632 | 633 | ||
633 | switch (trans_type) { | 634 | switch (trans_type) { |
634 | case USNIC_TRANSPORT_ROCE_CUSTOM: | 635 | case USNIC_TRANSPORT_ROCE_CUSTOM: |
@@ -637,9 +638,15 @@ static int qp_grp_id_from_flow(struct usnic_ib_qp_grp_flow *qp_flow, | |||
637 | case USNIC_TRANSPORT_IPV4_UDP: | 638 | case USNIC_TRANSPORT_IPV4_UDP: |
638 | err = usnic_transport_sock_get_addr(qp_flow->udp.sock, | 639 | err = usnic_transport_sock_get_addr(qp_flow->udp.sock, |
639 | NULL, NULL, | 640 | NULL, NULL, |
640 | (uint16_t *) id); | 641 | &port_num); |
641 | if (err) | 642 | if (err) |
642 | return err; | 643 | return err; |
644 | /* | ||
645 | * Copy port_num to stack first and then to *id, | ||
646 | * so that the short to int cast works for little | ||
647 | * and big endian systems. | ||
648 | */ | ||
649 | *id = port_num; | ||
643 | break; | 650 | break; |
644 | default: | 651 | default: |
645 | usnic_err("Unsupported transport %u\n", trans_type); | 652 | usnic_err("Unsupported transport %u\n", trans_type); |