lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 30 Jun 2022 08:21:51 +0000
From:   "Tian, Kevin" <kevin.tian@...el.com>
To:     Lu Baolu <baolu.lu@...ux.intel.com>,
        Joerg Roedel <joro@...tes.org>, Steve Wahl <steve.wahl@....com>
CC:     David Woodhouse <dwmw2@...radead.org>,
        Jerry Snitselaar <jsnitsel@...hat.com>,
        Mike Travis <mike.travis@....com>,
        Dimitri Sivanich <sivanich@....com>,
        "Anderson, Russ" <russ.anderson@....com>,
        "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v1 2/6] iommu/vt-d: Use IDA interface to manage iommu
 sequence id

> From: Lu Baolu <baolu.lu@...ux.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ