mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-19 17:20:59 +08:00
libblock: Return RTEMS_NO_MEMORY on allocation failure
In rtems_bdpart_register(), when create_logical_disk_name() fails to allocate memory and returns NULL, the error code variable 'esc' was incorrectly assigned 'sc' (which evaluates to RTEMS_SUCCESSFUL). This caused the function to falsely return RTEMS_SUCCESSFUL even when memory allocation failed. Fix it by assigning RTEMS_NO_MEMORY.
This commit is contained in:
@@ -105,7 +105,7 @@ rtems_status_code rtems_bdpart_register(
|
||||
&logical_disk_marker
|
||||
);
|
||||
if ( logical_disk_name == NULL ) {
|
||||
esc = sc;
|
||||
esc = RTEMS_NO_MEMORY;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user