[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aad94cba-5d07-b816-d307-382894f0a012@linuxfoundation.org>
Date: Fri, 1 Oct 2021 13:59:17 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Xiyu Yang <xiyuyang19@...an.edu.cn>
Cc: linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
linux-kernel@...r.kernel.org, yuanxzhang@...an.edu.cn,
Xin Tan <tanxin.ctf@...il.com>,
Brendan Higgins <brendanhiggins@...gle.com>,
Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH v2] kunit: fix reference count leak in kfree_at_end
On 9/28/21 3:27 PM, Brendan Higgins wrote:
> On Thu, Sep 9, 2021 at 12:26 AM Xiyu Yang <xiyuyang19@...an.edu.cn> wrote:
>>
>> 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().
>>
>> Signed-off-by: Xiyu Yang <xiyuyang19@...an.edu.cn>
>> Signed-off-by: Xin Tan <tanxin.ctf@...il.com>
>
> Reviewed-by: Brendan Higgins <brendanhiggins@...gle.com>
>
> Thanks!
>
Thank you for the fix.
Applied now after fixing a checkpatch alignment check to
git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/
kunit-fixes branch.
Please remember to run checkpatch.pl before sending patches.
thanks,
-- Shuah
Powered by blists - more mailing lists