lkml.org 
[lkml]   [2022]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v1 2/6] iommu/vt-d: Use IDA interface to manage iommu sequence id
Date
> From: Lu Baolu <baolu.lu@linux.intel.com>
> Sent: Saturday, June 25, 2022 8:52 PM
>
> @@ -1062,11 +1040,14 @@ static int alloc_iommu(struct dmar_drhd_unit
> *drhd)
> if (!iommu)
> return -ENOMEM;
>
> - if (dmar_alloc_seq_id(iommu) < 0) {
> + iommu->seq_id = ida_alloc_range(&dmar_seq_ids, 0,
> + DMAR_UNITS_SUPPORTED,

should be "DMAR_UNITS_SUPPORTED - 1"

> GFP_KERNEL);
> + if (iommu->seq_id < 0) {
> pr_err("Failed to allocate seq_id\n");
> err = -ENOSPC;
> goto error;
> }

ida_alloc_range() returns error code already. No need to change it.

\
 
 \ /
  Last update: 2022-06-30 10:23    [W:0.356 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site