Skip to content
Commit 9cbb0503 authored by Hewenliang's avatar Hewenliang Committed by Paul Gortmaker
Browse files

kselftests: cgroup: Avoid the reuse of fd after it is deallocated



commit d671fa63 upstream.

It is necessary to set fd to -1 when inotify_add_watch() fails in
cg_prepare_for_wait. Otherwise the fd which has been closed in
cg_prepare_for_wait may be misused in other functions such as
cg_enter_and_wait_for_frozen and cg_freeze_wait.

Fixes: 5313bfe4 ("selftests: cgroup: add freezer controller self-tests")
Signed-off-by: default avatarHewenliang <hewenliang4@huawei.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent dc369b69
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment