Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • lib
  • kunit
  • executor_test.c
Find file BlameHistoryPermalink
  • Xiyu Yang's avatar
    kunit: fix reference count leak in kfree_at_end · f62314b1
    Xiyu Yang authored Sep 09, 2021
    
    
    The reference counting issue happens in the normal path of
    kfree_at_end(). When kunit_alloc_and_get_resource() is invoked, the
    function forgets to handle the returned resource object, whose refcount
    increased inside, causing a refcount leak.
    
    Fix this issue by calling kunit_alloc_resource() instead of
    kunit_alloc_and_get_resource().
    
    Fixed the following when applying:
    Shuah Khan <skhan@linuxfoundation.org>
    
    CHECK: Alignment should match open parenthesis
    +	kunit_alloc_resource(test, NULL, kfree_res_free, GFP_KERNEL,
     				     (void *)to_free);
    
    Signed-off-by: default avatarXiyu Yang <xiyuyang19@fudan.edu.cn>
    Signed-off-by: default avatarXin Tan <tanxin.ctf@gmail.com>
    Reviewed-by: default avatarDaniel Latypov <dlatypov@google.com>
    Reviewed-by: default avatarBrendan Higgins <brendanhiggins@google.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    f62314b1
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7