[Mesa-dev] [PATCH v5 1/2] gallium/winsys/kms: Fix possible leak in map/unmap.

Tomasz Figa tfiga at chromium.org
Mon Mar 19 09:32:50 UTC 2018


Hi Lepton,

On Sat, Mar 17, 2018 at 3:09 AM, Lepton Wu <lepton at chromium.org> wrote:
> If user calls map twice for kms_sw_displaytarget, the first mapped
> buffer could get leaked. Instead of calling mmap every time, just
> reuse previous mapping. Since user could map same displaytarget with
> different flags, we have to keep two different pointers, one for rw
> mapping and one for ro mapping. Also introduce reference count for
> mapped buffer so we can unmap them at right time.
>
> Change-Id: I65308f0ff2640bd57b2577c6a3469540c9722859

Change-Id shouldn't be included in upstream patches.

> Signed-off-by: Lepton Wu <lepton at chromium.org>
> ---
>  .../winsys/sw/kms-dri/kms_dri_sw_winsys.c     | 44 +++++++++++++++----
>  1 file changed, 36 insertions(+), 8 deletions(-)

Other than that:

Reviewed-by: Tomasz Figa <tfiga at chromium.org>

Thanks for addressing the comments.

Best regards,
Tomasz


More information about the mesa-dev mailing list