Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvidia_p2p_get_pages(): Fix double-free in register-callback error path #557

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion kernel-open/nvidia/nv-p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ static int nv_p2p_get_pages(
*page_table, nv_p2p_mem_info_free_callback, mem_info);
if (status != NV_OK)
{
goto failed;
goto failed_nofree;
}
}

Expand All @@ -542,6 +542,7 @@ static int nv_p2p_get_pages(
os_free_mem(rreqmb_h);
}

failed_nofree:
if (bGetPages)
{
(void)nv_p2p_put_pages(pt_type, sp, p2p_token, va_space,
Expand Down