RTEMS | cpukit/aio_misc Add error handling for calloc failure (!513)
shuhua hua (@huangshuhua)
gitlab at rtems.org
Fri Jun 20 07:47:34 UTC 2025
shuhua hua commented on a discussion on cpukit/posix/src/aio_misc.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/513#note_125000
> r_chain = NULL;
> } else {
> r_chain = calloc( 1, sizeof( rtems_aio_request_chain ) );
> + if ( r_chain == NULL ) {
> + errno = EAGAIN;
Thank you for the correction feedback. Initially, I returned EAGAIN to maintain consistency with how init_write_req and init_read_req handle malloc failures in the existing code. If you believe it’s necessary to change this to ENOMEM, I will revise the implementation and push the changes accordingly.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/513#note_125000
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/20250620/ccf3a3cc/attachment-0001.htm>
More information about the bugs
mailing list