IB/srp: Fix indirect data buffer rkey endianness
authorBart Van Assche <[email protected]>
Tue, 1 Dec 2015 18:18:47 +0000 (10:18 -0800)
committerDoug Ledford <[email protected]>
Mon, 7 Dec 2015 22:20:11 +0000 (17:20 -0500)
Detected by sparse.

Fixes: commit 330179f2fa93 ("IB/srp: Register the indirect data buffer descriptor")
Signed-off-by: Bart Van Assche <[email protected]>
Cc: stable <[email protected]> # v4.3+
Cc: Sagi Grimberg <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Sebastian Parschauer <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
drivers/infiniband/ulp/srp/ib_srp.c

index 72fac204d7562a28e245a816edf40b721695faa5..fac142389731d995d9e616b7b84fde81c6313879 100644 (file)
@@ -1662,7 +1662,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_rdma_ch *ch,
                        return ret;
                req->nmdesc++;
        } else {
-               idb_rkey = target->global_mr->rkey;
+               idb_rkey = cpu_to_be32(target->global_mr->rkey);
        }
 
        indirect_hdr->table_desc.va = cpu_to_be64(req->indirect_dma_addr);