Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • chendotjs
  • linux
  • Repository
Switch branch/tag
  • linux
  • drivers
  • dma-buf
  • sync_file.c
Find file BlameHistoryPermalink
  • Jason Ekstrand's avatar
    dma-buf/sync_file: Don't leak fences on merge failure · ffe00021
    Jason Ekstrand authored Jun 24, 2021
    
    
    Each add_fence() call does a dma_fence_get() on the relevant fence.  In
    the error path, we weren't calling dma_fence_put() so all those fences
    got leaked.  Also, in the krealloc_array failure case, we weren't
    freeing the fences array.  Instead, ensure that i and fences are always
    zero-initialized and dma_fence_put() all the fences and kfree(fences) on
    every error path.
    
    Signed-off-by: default avatarJason Ekstrand <jason@jlekstrand.net>
    Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
    Fixes: a02b9dc9 ("dma-buf/sync_file: refactor fence storage in struct sync_file")
    Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
    Cc: Christian König <christian.koenig@amd.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210624174732.1754546-1-jason@jlekstrand.net
    
    
    Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
    ffe00021