On 8/11/2014 6:35 PM, Konrad Rzeszutek Wilk wrote:
> On Mon, Aug 11, 2014 at 03:45:50PM -0700, Olav Haugan wrote:
> .. snip..
>> +    for_each_sg(sg, s, nents, i) {
>> +            phys_addr_t phys = page_to_phys(sg_page(s));
>> +            size_t page_len = s->offset + s->length;
>> +
>> +            ret = iommu_map(domain, iova + offset, phys, page_len,
>> +                            prot);
>> +            if (ret) {
>> +                    /* undo mappings already done */
>> +                    iommu_unmap(domain, iova, offset);
> 
> Don't we want then to unmap all of the scatter list instead of just
> the last one?
> 

It reverts all the mapping that was already done up until the error
occurred. "offset" contains the amount we have mapped so far.

Thanks,

Olav

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to