mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-27 16:01:27 +00:00
efi_selftest: memory leak testing manage protocols
Remove memory leak in efi_selftest_manageprotocols.c. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
9dc8d155d4
commit
e470efd2d9
1 changed files with 19 additions and 2 deletions
|
@ -179,7 +179,12 @@ static int execute(void)
|
||||||
efi_st_error("LocateHandleBuffer failed to locate new handle\n");
|
efi_st_error("LocateHandleBuffer failed to locate new handle\n");
|
||||||
return EFI_ST_FAILURE;
|
return EFI_ST_FAILURE;
|
||||||
}
|
}
|
||||||
boottime->set_mem(buffer, sizeof(efi_handle_t) * buffer_size, 0);
|
/* Release buffer */
|
||||||
|
ret = boottime->free_pool(buffer);
|
||||||
|
if (ret != EFI_SUCCESS) {
|
||||||
|
efi_st_error("FreePool failed\n");
|
||||||
|
return EFI_ST_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test error handling in UninstallMultipleProtocols
|
* Test error handling in UninstallMultipleProtocols
|
||||||
|
@ -221,6 +226,7 @@ static int execute(void)
|
||||||
efi_st_error("LocateHandleBuffer failed to locate new handle\n");
|
efi_st_error("LocateHandleBuffer failed to locate new handle\n");
|
||||||
return EFI_ST_FAILURE;
|
return EFI_ST_FAILURE;
|
||||||
}
|
}
|
||||||
|
/* Clear the buffer, we are reusing it it the next step. */
|
||||||
boottime->set_mem(buffer, sizeof(efi_handle_t) * buffer_size, 0);
|
boottime->set_mem(buffer, sizeof(efi_handle_t) * buffer_size, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -248,7 +254,12 @@ static int execute(void)
|
||||||
efi_st_error("LocateHandle failed to locate new handles\n");
|
efi_st_error("LocateHandle failed to locate new handles\n");
|
||||||
return EFI_ST_FAILURE;
|
return EFI_ST_FAILURE;
|
||||||
}
|
}
|
||||||
boottime->set_mem(buffer, sizeof(efi_handle_t) * buffer_size, 0);
|
/* Release buffer */
|
||||||
|
ret = boottime->free_pool(buffer);
|
||||||
|
if (ret != EFI_SUCCESS) {
|
||||||
|
efi_st_error("FreePool failed\n");
|
||||||
|
return EFI_ST_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test LocateProtocol
|
* Test LocateProtocol
|
||||||
|
@ -319,6 +330,12 @@ static int execute(void)
|
||||||
efi_st_error("Failed to get protocols per handle\n");
|
efi_st_error("Failed to get protocols per handle\n");
|
||||||
return EFI_ST_FAILURE;
|
return EFI_ST_FAILURE;
|
||||||
}
|
}
|
||||||
|
/* Release buffer */
|
||||||
|
ret = boottime->free_pool(prot_buffer);
|
||||||
|
if (ret != EFI_SUCCESS) {
|
||||||
|
efi_st_error("FreePool failed\n");
|
||||||
|
return EFI_ST_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Uninstall remaining protocols
|
* Uninstall remaining protocols
|
||||||
|
|
Loading…
Add table
Reference in a new issue