[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b877f4dd-08a7-4298-80d4-be3570c8fe93@gmail.com>
Date: Mon, 16 Dec 2024 12:28:12 +0200
From: Abdiel Janulgue <abdiel.janulgue@...il.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: rust-for-linux@...r.kernel.org, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, Valentin Obst <kernel@...entinobst.de>,
open list <linux-kernel@...r.kernel.org>, Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>, airlied@...hat.com,
"open list:DMA MAPPING HELPERS" <iommu@...ts.linux.dev>,
Daniel Almeida <daniel.almeida@...labora.com>
Subject: Re: [PATCH v7 2/2] rust: add dma coherent allocator abstraction.
On 13/12/2024 16:27, Alice Ryhl wrote:
>
>> + /// Returns the base address to the allocated region and the dma handle. The caller takes
>> + /// ownership of the returned resources.
>> + pub fn into_parts(self) -> (usize, bindings::dma_addr_t) {
>> + let ret = (self.cpu_addr as _, self.dma_handle);
>> + core::mem::forget(self);
>> + ret
>> + }
>
> Not only does this skip the destructor of `dma_free_attrs`. It also
> skips the destructor of fields including the `dev` field. Did you
> intend to leave the refcount on `struct device` without decrementing
> it?
>
Good catch. Yeah dev should be decremented here as well.
Will incorporate fix into next revision.
Regards,
Abdiel
Powered by blists - more mailing lists