On 2/2/21 6:35 PM, Thomas Huth wrote:
On 29/01/2021 15.34, Pierre Morel wrote:
...snip...
static void test_schm(void)
{
+ struct measurement_block_format0 *mb0;
+
if (css_general_feature(CSSC_EXTENDED_MEASUREMENT_BLOCK))
report_info("Extended measurement block available");
+
+ mb0 = alloc_io_mem(sizeof(struct measurement_block_format0), 0);
+ if (!mb0) {
+ report(0, "measurement_block_format0 allocation");
+ goto end_free;
If allocation failed, there is certainly no need to try to free it, so
:) yes
you can get rid of the goto and the label here and return directly
instead. Or maybe
Maybe also simply use report_abort() in this case?
OK, report_abort when an allocation failed seems right.
Thanks,
Pierre
--
Pierre Morel
IBM Lab Boeblingen