[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAO_48GHxanR=-mN232ANwxQEiBo9zb3WjvO-6WmP6eFYWA1M5A@mail.gmail.com>
Date: Wed, 1 Dec 2021 15:39:17 +0530
From: Sumit Semwal <sumit.semwal@...aro.org>
To: John Stultz <john.stultz@...aro.org>
Cc: guangming.cao@...iatek.com, greg@...ah.com, brian.starkey@....com,
benjamin.gaignard@...aro.org, christian.koenig@....com,
dri-devel@...ts.freedesktop.org, labbott@...hat.com,
linaro-mm-sig@...ts.linaro.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linux-mediatek@...ts.infradead.org,
lmark@...eaurora.org, matthias.bgg@...il.com, robin.murphy@....com,
stable@...r.kernel.org, wsd_upstream@...iatek.com,
kuan-ying.lee@...iatek.com
Subject: Re: [PATCH v4] dma-buf: system_heap: Use 'for_each_sgtable_sg' in
pages free flow
Hello Guangming,
On Mon, 29 Nov 2021 at 23:35, John Stultz <john.stultz@...aro.org> wrote:
>
> On Thu, Nov 25, 2021 at 11:48 PM <guangming.cao@...iatek.com> wrote:
> >
> > From: Guangming <Guangming.Cao@...iatek.com>
> >
> > For previous version, it uses 'sg_table.nent's to traverse sg_table in pages
> > free flow.
> > However, 'sg_table.nents' is reassigned in 'dma_map_sg', it means the number of
> > created entries in the DMA adderess space.
> > So, use 'sg_table.nents' in pages free flow will case some pages can't be freed.
> >
> > Here we should use sg_table.orig_nents to free pages memory, but use the
> > sgtable helper 'for each_sgtable_sg'(, instead of the previous rather common
> > helper 'for_each_sg' which maybe cause memory leak) is much better.
Thanks for catching this and the patch; applied to drm-misc-fixes.
> >
> > Fixes: d963ab0f15fb0 ("dma-buf: system_heap: Allocate higher order pages if available")
> > Signed-off-by: Guangming <Guangming.Cao@...iatek.com>
> > Reviewed-by: Robin Murphy <robin.murphy@....com>
> > Cc: <stable@...r.kernel.org> # 5.11.*
>
> Thanks so much for catching this and sending in all the revisions!
>
> Reviewed-by: John Stultz <john.stultz@...aro.org>
Best,
Sumit.
--
Thanks and regards,
Sumit Semwal (he / him)
Tech Lead - LCG, Vertical Technologies
Linaro.org │ Open source software for ARM SoCs
Powered by blists - more mailing lists