Elyes Haouas has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/70063?usp=email )
Change subject: acpi: Helper functions to add certain _DSD properties ......................................................................
Patch Set 11:
(1 comment)
Patchset:
PS11: -fanalyzer gives me:
`src/acpi/device.c:1232:1: error: leak of '<unknown>' [CWE-401] [-Werror=analyzer-malloc-leak] 1232 | } | ^ 'acpi_device_add_integer_property_with_uuid': events 1-4 | | 1219 | static void acpi_device_add_integer_property_with_uuid(struct acpi_dp *dsd, | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (1) entry to 'acpi_device_add_integer_property_with_uuid' |...... | 1225 | if (prev_dsd == NULL) | | ~ | | | | | (2) following 'false' branch (when 'dsd' is non-NULL)... | 1226 | dsd = acpi_dp_new_table("_DSD"); | 1227 | pkg = acpi_dp_new_table(uuid); | | ~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (3) ...to here | | (4) calling 'acpi_dp_new_table' from 'acpi_device_add_integer_property_with_uuid' | +--> 'acpi_dp_new_table': events 5-6 | | 953 | struct acpi_dp *acpi_dp_new_table(const char *name) | | ^~~~~~~~~~~~~~~~~ | | | | | (5) entry to 'acpi_dp_new_table' | 954 | { | 955 | return acpi_dp_new(NULL, ACPI_DP_TYPE_TABLE, name); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (6) calling 'acpi_dp_new' from 'acpi_dp_new_table' | +--> 'acpi_dp_new': events 7-10 | | 929 | static struct acpi_dp *acpi_dp_new(struct acpi_dp *dp, enum acpi_dp_type type, | | ^~~~~~~~~~~ | | | | | (7) entry to 'acpi_dp_new' |...... | 935 | if (!new) | | ~ | | | | | (8) following 'false' branch (when 'new' is non-NULL)... |...... | 938 | memset(new, 0, sizeof(*new)); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (9) ...to here |...... | 943 | if (dp) { | | ~ | | | | | (10) following 'false' branch (when 'dp' is NULL)... | 'acpi_dp_new': event 11 | |cc1: | (11): ...to here | <------+ | 'acpi_dp_new_table': event 12 | | 955 | return acpi_dp_new(NULL, ACPI_DP_TYPE_TABLE, name); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (12) returning to 'acpi_dp_new_table' from 'acpi_dp_new' | <------+ | 'acpi_device_add_integer_property_with_uuid': events 13-14 | | 1227 | pkg = acpi_dp_new_table(uuid); | | ^~~~~~~~~~~~~~~~~~~~~~~ | | | | | (13) returning to 'acpi_device_add_integer_property_with_uuid' from 'acpi_dp_new_table' | 1228 | acpi_dp_add_integer(pkg, name, value); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (14) calling 'acpi_dp_add_integer' from 'acpi_device_add_integer_property_with_uuid' | +--> 'acpi_dp_add_integer': events 15-18 | | 1000 | struct acpi_dp *acpi_dp_add_integer(struct acpi_dp *dp, const char *name, | | ^~~~~~~~~~~~~~~~~~~ | | | | | (15) entry to 'acpi_dp_add_integer' |...... | 1003 | if (!dp) | | ~ | | | | | (16) following 'false' branch (when 'dp' is non-NULL)... |...... | 1006 | struct acpi_dp *new = acpi_dp_new(dp, ACPI_DP_TYPE_INTEGER, name); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (17) ...to here | | (18) calling 'acpi_dp_new' from 'acpi_dp_add_integer' | +--> 'acpi_dp_new': events 19-24 | | 929 | static struct acpi_dp *acpi_dp_new(struct acpi_dp *dp, enum acpi_dp_type type, | | ^~~~~~~~~~~ | | | | | (19) entry to 'acpi_dp_new' |...... | 934 | new = malloc(sizeof(struct acpi_dp)); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (20) allocated here | 935 | if (!new) | | ~ | | | | | (21) assuming 'new' is non-NULL | | (22) following 'false' branch (when 'new' is non-NULL)... |...... | 938 | memset(new, 0, sizeof(*new)); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (23) ...to here |...... | 943 | if (dp) { | | ~ | | | | | (24) following 'true' branch (when 'dp' is non-NULL)... | 'acpi_dp_new': event 25 | |cc1: | (25): ...to here | 'acpi_dp_new': events 26-27 | | 945 | while (dp->next) | | ^~ | | | | | (26) following 'false' branch... | 946 | dp = dp->next; | 947 | dp->next = new; | | ~~~~~~~~~~~~~~ | | | | | (27) ...to here | <------+ | 'acpi_dp_add_integer': events 28-30 | | 1006 | struct acpi_dp *new = acpi_dp_new(dp, ACPI_DP_TYPE_INTEGER, name); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (28) returning to 'acpi_dp_add_integer' from 'acpi_dp_new' | 1007 | | 1008 | if (new) | | ~ | | | | | (29) following 'true' branch (when 'new' is non-NULL)... | 1009 | new->integer = value; | | ~~~~~~~~~~~~~~~~~~~~ | | | | | (30) ...to here | <------+ | 'acpi_device_add_integer_property_with_uuid': events 31-32 | | 1228 | acpi_dp_add_integer(pkg, name, value); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (31) returning to 'acpi_device_add_integer_property_with_uuid' from 'acpi_dp_add_integer' | 1229 | acpi_dp_add_package(dsd, pkg); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (32) calling 'acpi_dp_add_package' from 'acpi_device_add_integer_property_with_uuid' | +--> 'acpi_dp_add_package': events 33-34 | | 1059 | struct acpi_dp *acpi_dp_add_package(struct acpi_dp *dp, struct acpi_dp *package) | | ^~~~~~~~~~~~~~~~~~~ | | | | | (33) entry to 'acpi_dp_add_package' |...... | 1063 | if (!dp || !package || package->type != ACPI_DP_TYPE_TABLE) | | ~ | | | | | (34) following 'false' branch... | 'acpi_dp_add_package': event 35 | |cc1: | (35): ...to here | 'acpi_dp_add_package': event 36 | |cc1: | (36): calling 'acpi_dp_add_package.part.0' from 'acpi_dp_add_package' | +--> 'acpi_dp_add_package.part.0': events 37-38 | | 1059 | struct acpi_dp *acpi_dp_add_package(struct acpi_dp *dp, struct acpi_dp *package) | | ^~~~~~~~~~~~~~~~~~~ | | | | | (37) entry to 'acpi_dp_add_package.part.0' |...... | 1066 | new = acpi_dp_new(dp, ACPI_DP_TYPE_PACKAGE, NULL); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (38) calling 'acpi_dp_new' from 'acpi_dp_add_package.part.0' | +--> 'acpi_dp_new': events 39-40 | | 929 | static struct acpi_dp *acpi_dp_new(struct acpi_dp *dp, enum acpi_dp_type type, | | ^~~~~~~~~~~ | | | | | (39) entry to 'acpi_dp_new' |...... | 935 | if (!new) | | ~ | | | | | (40) following 'true' branch (when 'new' is NULL)... | 'acpi_dp_new': event 41 | |cc1: | (41): ...to here | <------+ | 'acpi_dp_add_package.part.0': events 42-43 | | 1066 | new = acpi_dp_new(dp, ACPI_DP_TYPE_PACKAGE, NULL); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (42) returning to 'acpi_dp_add_package.part.0' from 'acpi_dp_new' | 1067 | if (new) { | | ~ | | | | | (43) following 'false' branch (when 'new' is NULL)... | 'acpi_dp_add_package.part.0': event 44 | |cc1: | (44): ...to here | <------+ | 'acpi_dp_add_package': event 45 | |cc1: | (45): returning to 'acpi_dp_add_package' from 'acpi_dp_add_package.part.0' | <------+ | 'acpi_device_add_integer_property_with_uuid': events 46-49 | | 1229 | acpi_dp_add_package(dsd, pkg); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (46) returning to 'acpi_device_add_integer_property_with_uuid' from 'acpi_dp_add_package' | 1230 | if (prev_dsd == NULL) | | ~ | | | | | (47) following 'false' branch (when 'dsd' is non-NULL)... | 1231 | acpi_dp_write(dsd); | 1232 | } | | ~ | | | | | (48) ...to here | | (49) '<unknown>' leaks here; was allocated at (20) | cc1: all warnings being treated as errors make: *** [Makefile:419 : build/ramstage/acpi/device.o] Erreur 1 `