]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drivers/infiniband/ulp/srpt/ib_srpt.c: fix build with gcc-4.4.4
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 13 Mar 2018 22:06:45 +0000 (15:06 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 15:50:08 +0000 (11:50 -0400)
BugLink: http://bugs.launchpad.net/bugs/1773233
commit 06892cc190550807d332c95a0114c7e175584012 upstream.

gcc-4.4.4 has issues with initialization of anonymous unions:

drivers/infiniband/ulp/srpt/ib_srpt.c: In function 'srpt_zerolength_write':
drivers/infiniband/ulp/srpt/ib_srpt.c:854: error: unknown field 'wr_cqe' specified in initializer
drivers/infiniband/ulp/srpt/ib_srpt.c:854: warning: initialization makes integer from pointer without a cast

Work aound this.

Fixes: 2a78cb4db487 ("IB/srpt: Fix an out-of-bounds stack access in srpt_zerolength_write()")
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/ulp/srpt/ib_srpt.c

index fbf1c12ac2c5588e6f15a0d28f81f83cec2f7edf..132d4c45e3070af5543ef63264f29aadcc781904 100644 (file)
@@ -803,8 +803,9 @@ static int srpt_zerolength_write(struct srpt_rdma_ch *ch)
        struct ib_send_wr *bad_wr;
        struct ib_rdma_wr wr = {
                .wr = {
+                       .next           = NULL,
+                       { .wr_cqe       = &ch->zw_cqe, },
                        .opcode         = IB_WR_RDMA_WRITE,
-                       .wr_cqe         = &ch->zw_cqe,
                        .send_flags     = IB_SEND_SIGNALED,
                }
        };