Matt Delco has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42470 )
Change subject: drivers/intel/mipi_camera: Add support to handle CIO2 device ......................................................................
Patch Set 14:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42470/12/src/drivers/intel/mipi_cam... File src/drivers/intel/mipi_camera/camera.c:
https://review.coreboot.org/c/coreboot/+/42470/12/src/drivers/intel/mipi_cam... PS12, Line 87: for (i = 0; i < config->cio2_num_ports; ++i) { : free(ep_table_name[i]); : free(port_table_name[i]); : free(port_name[i]); : }
Done. I have removed them.
Hrm, given the style's suggestion to use malloc() as a last resort another option is to use something like:
char ep_table_name[MAX_PORT_ENTRIES][BUS_PATH_MAX] = {""}; char port_table_name[MAX_PORT_ENTRIES][BUS_PATH_MAX] = {""}; char port_name[MAX_PORT_ENTRIES][BUS_PATH_MAX] = {""};
and then delete "char name[BUS_PATH_MAX];" and replace instances like:
snprintf(name, sizeof(name), "EP%u0", i); ep_table_name[i] = strdup(name);
with:
snprintf(ep_table_name[i], sizeof(ep_table_name[i]), "EP%u0", i);