RTEMS | bsps/shared/gpio: Fix group define leaks (!1281)
Gedare Bloom (@gedare)
gitlab at rtems.org
Wed Jun 3 14:30:06 UTC 2026
Gedare Bloom started a new discussion on bsps/shared/dev/gpio/gpio-support.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1281#note_151680
> return RTEMS_UNSATISFIED;
> }
>
> + group->digital_inputs = NULL;
> + group->digital_outputs = NULL;
> + group->bsp_speficifc_pins = NULL;
> +
> group->input_count = group_definition->input_count;
>
> if ( group->input_count > 0 ) {
> group->digital_inputs =
> (uint32_t *) malloc(group->input_count * sizeof(uint32_t));
>
> + if ( group->digital_inputs == NULL ) {
> + sc = RTEMS_NO_MEMORY;
> + goto failed_alloc;
we would prefer to avoid `goto` method of handling cleanup. in this case a better option would be a static helper function call.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1281#note_151680
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260603/46a11de1/attachment-0001.htm>
More information about the bugs
mailing list