Details
-
Bug
-
Resolution: Fixed
-
Medium
-
None
-
None
-
3
-
9223372036854775807
Description
if (tn->tn_gpu) {
rc = lnet_rdma_map_sg_attrs(dev->device, tn->tn_sgt.sgl,
sg_count, tn->tn_dmadir);
if (rc > 0)
tn->tn_sgt.nents = rc;
} else {
rc = dma_map_sgtable(dev->device, &tn->tn_sgt, tn->tn_dmadir,
0);
}
tn->tn_sgt_mapped = true;
/* tn_num_iovec used for convenience in some debug messages */
tn->tn_num_iovec = tn->tn_sgt.nents;
The return value of dma_map_sgtable() is not checked for errors. If this call fails, tn->tn_sgt_mapped will still be set to true, which may cause resource leaks or undefined behavior later.