-
Notifications
You must be signed in to change notification settings - Fork 396
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
prov/efa: fix bug in error handling in efa_device_construct() #7806
prov/efa: fix bug in error handling in efa_device_construct() #7806
Conversation
@wzamazon How can we test this bug fix? |
I am writing a unit test that mock |
1a3cfcf
to
0fd10cd
Compare
@shijin-aws I added a commit to include a unit test that mimic original bug, please review again. |
efa_device_construct(&efa_device, 0, ibv_device_list[0]); | ||
|
||
/* when error happend, efa_device.ibv_ctx should be NULL */ | ||
assert_null(efa_device.ibv_ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not we check efa_device->rdm_info
and efa_device->dgram_info
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense. added in new revision.
This patch added a unit test for the error handling of function efa_device_construct(), this is to reproduce the GitHub issue: ofiwg#7805 Signed-off-by: Wei Zhang <wzam@amazon.com>
In function efa_device_construct()'s error handling path, resources (like ibv_ctx) were released, but the pointer was not reset to NULL, which can caused double free. This patch addressed the issue. Signed-off-by: Wei Zhang <wzam@amazon.com>
0fd10cd
to
65eff4f
Compare
In function efa_device_construct()'s error handling path, resources
(like ibv_ctx) were released, but the pointer was not reset to NULL,
which can caused double free. This patch addressed the issue.
Signed-off-by: Wei Zhang wzam@amazon.com