Skip to content

Commit

Permalink
drivers/infiniband/core/verbs.c: fix build with gcc-4.4.4
Browse files Browse the repository at this point in the history
gcc-4.4.4 has issues with initialization of anonymous unions.

drivers/infiniband/core/verbs.c: In function '__ib_drain_sq':
drivers/infiniband/core/verbs.c:2204: error: unknown field 'wr_cqe' specified in initializer
drivers/infiniband/core/verbs.c:2204: warning: initialization makes integer from pointer without a cast

Work around this.

Fixes: a1ae7d0 ("RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access")
Cc: Bart Van Assche <[email protected]>
Cc: Steve Wise <[email protected]>
Cc: Sagi Grimberg <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
akpm00 authored and dledford committed Mar 14, 2018
1 parent 43c9fc5 commit 6ee6877
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/infiniband/core/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2196,8 +2196,9 @@ static void __ib_drain_sq(struct ib_qp *qp)
struct ib_send_wr *bad_swr;
struct ib_rdma_wr swr = {
.wr = {
.next = NULL,
{ .wr_cqe = &sdrain.cqe, },
.opcode = IB_WR_RDMA_WRITE,
.wr_cqe = &sdrain.cqe,
},
};
int ret;
Expand Down

0 comments on commit 6ee6877

Please sign in to comment.