Re: [kvm-unit-tests PATCH v1 4/5] s390x: css: SCHM tests format 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux