From: Dasaratharaman Chandramouli Date: Sat, 29 Apr 2017 18:41:17 +0000 (-0400) Subject: IB/rxe: Initialize ib_ah_attr during query_ah X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eca7ddf965e0d6b0b1e4e6dea207f2015b65d367;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Don Hiatt Reviewed-by: Sean Hefty Signed-off-by: Dasaratharaman Chandramouli Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/sw/rxe/rxe_av.c b/drivers/infiniband/sw/rxe/rxe_av.c index 604f6fee96bd..88a4a7f15fbd 100644 --- a/drivers/infiniband/sw/rxe/rxe_av.c +++ b/drivers/infiniband/sw/rxe/rxe_av.c @@ -69,6 +69,7 @@ int rxe_av_to_attr(struct rxe_dev *rxe, struct rxe_av *av, struct ib_ah_attr *attr) { memcpy(&attr->grh, &av->grh, sizeof(av->grh)); + attr->ah_flags = IB_AH_GRH; attr->port_num = av->port_num; return 0; } diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index dbede3026138..b35201dd03bd 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -378,6 +378,7 @@ static int rxe_query_ah(struct ib_ah *ibah, struct ib_ah_attr *attr) struct rxe_dev *rxe = to_rdev(ibah->device); struct rxe_ah *ah = to_rah(ibah); + memset(attr, 0, sizeof(*attr)); rxe_av_to_attr(rxe, &ah->av, attr); return 0; }