IB/srp: Fix srp_map_data() error paths
authorBart Van Assche <bart.vanassche@sandisk.com>
Fri, 22 Apr 2016 21:13:35 +0000 (14:13 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 12 May 2016 18:18:55 +0000 (14:18 -0400)
commite012f3639c95498d4e8d7a9f44e33f1cd2f241b0
tree5fadfe86d8167acee6b01e13758034f865b84d64
parent77269cdfcab5f01ebd2095273f4060fbe1001e68
IB/srp: Fix srp_map_data() error paths

Ensure that req->nmdesc is set correctly in srp_map_sg() if mapping
fails. Avoid that mapping failure causes a memory descriptor leak.
Report srp_map_sg() failure to the caller.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srp/ib_srp.c