[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190529061756.GB26055@infradead.org>
Date: Tue, 28 May 2019 23:17:56 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Eric Auger <eric.auger@...hat.com>
Cc: eric.auger.pro@...il.com, joro@...tes.org,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
dwmw2@...radead.org, robin.murphy@....com,
jean-philippe.brucker@....com, alex.williamson@...hat.com
Subject: Re: [PATCH v5 1/7] iommu: Fix a leak in iommu_insert_resv_region
> } else if ((start >= a) && (end <= b)) {
> if (new->type == type)
> - goto done;
> + return 0;
> else
> pos = pos->next;
Please remove the pointless else after the return statement.
> } else {
> if (new->type == type) {
> phys_addr_t new_start = min(a, start);
> phys_addr_t new_end = max(b, end);
> + int ret;
>
> list_del(&entry->list);
> entry->start = new_start;
> entry->length = new_end - new_start + 1;
> - iommu_insert_resv_region(entry, regions);
> + ret = iommu_insert_resv_region(entry, regions);
> + kfree(entry);
> + return ret;
> } else {
> pos = pos->next;
> }
Same here.
Powered by blists - more mailing lists