Skip to content

Commit eca7ddf

Browse files
Dasaratharaman Chandramoulidledford
authored andcommitted
IB/rxe: Initialize ib_ah_attr during query_ah
Zero out ib_ah_attr before calling query_ah. Set ah_flags appropriately. Reviewed-by: Ira Weiny <[email protected]> Reviewed-by: Don Hiatt <[email protected]> Reviewed-by: Sean Hefty <[email protected]> Signed-off-by: Dasaratharaman Chandramouli <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 4ba6609 commit eca7ddf

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

drivers/infiniband/sw/rxe/rxe_av.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ int rxe_av_to_attr(struct rxe_dev *rxe, struct rxe_av *av,
6969
struct ib_ah_attr *attr)
7070
{
7171
memcpy(&attr->grh, &av->grh, sizeof(av->grh));
72+
attr->ah_flags = IB_AH_GRH;
7273
attr->port_num = av->port_num;
7374
return 0;
7475
}

drivers/infiniband/sw/rxe/rxe_verbs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ static int rxe_query_ah(struct ib_ah *ibah, struct ib_ah_attr *attr)
378378
struct rxe_dev *rxe = to_rdev(ibah->device);
379379
struct rxe_ah *ah = to_rah(ibah);
380380

381+
memset(attr, 0, sizeof(*attr));
381382
rxe_av_to_attr(rxe, &ah->av, attr);
382383
return 0;
383384
}

0 commit comments

Comments
 (0)