re: ACPICA: ACPI 2.0, Interpreter: Fix MLC issues by switching to new TermList grammar for table loading

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

 



Hello Lv Zheng,

The patch 0bfd2f1ec274: "ACPICA: ACPI 2.0, Interpreter: Fix MLC
issues by switching to new TermList grammar for table loading" from
May 13, 2016, leads to the following static checker warning:

	drivers/acpi/acpica/nsparse.c:139 acpi_ns_execute_table()
	error: we previously assumed 'info' could be null (see line 110)

drivers/acpi/acpica/nsparse.c
   135          (void)acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
   136  
   137  cleanup:
   138          acpi_ut_remove_reference(method_obj);
   139          ACPI_FREE(info->full_pathname);
                          ^^^^^^^^^^^^^^^^^^^
Archetypal one err bug.  It's better to unwind in reverse order from how
you allacted things and only free things you have allocated.  Use more
than one label.  Also you can use more descriptive label names.

	(void)acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);

free_pathname:
	ACPI_FREE(info->full_pathname);
free_info:
	ACPI_FREE(info);
remove_method:
	acpi_ut_remove_reference(method_obj);

	return_ACPI_STATUS(status);


   140          info->full_pathname = NULL;
   141          ACPI_FREE(info);
   142          return_ACPI_STATUS(status);
   143  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux