diff options
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/include/rtems/blkdev.h | 1 | ||||
-rw-r--r-- | cpukit/libblock/src/blkdev-imfs.c | 14 |
2 files changed, 11 insertions, 4 deletions
diff --git a/cpukit/include/rtems/blkdev.h b/cpukit/include/rtems/blkdev.h index 3f829e6068..929cf4fc24 100644 --- a/cpukit/include/rtems/blkdev.h +++ b/cpukit/include/rtems/blkdev.h @@ -296,6 +296,7 @@ rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp); * @retval RTEMS_INVALID_NUMBER Media block size or count is not positive. * @retval RTEMS_NO_MEMORY Not enough memory. * @retval RTEMS_UNSATISFIED Cannot create generic device node. + * @retval RTEMS_INCORRECT_STATE Cannot initialize bdbuf. * * @see rtems_blkdev_create_partition(), rtems_bdbuf_set_block_size(), and * rtems_blkdev_request. diff --git a/cpukit/libblock/src/blkdev-imfs.c b/cpukit/libblock/src/blkdev-imfs.c index ebe6ebb1d7..a46babb593 100644 --- a/cpukit/libblock/src/blkdev-imfs.c +++ b/cpukit/libblock/src/blkdev-imfs.c @@ -6,10 +6,10 @@ */ /* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * Copyright (c) 2012, 2018 embedded brains GmbH. All rights reserved. * * embedded brains GmbH - * Obere Lagerstr. 30 + * Dornierstr. 4 * 82178 Puchheim * Germany * <rtems@embedded-brains.de> @@ -279,9 +279,15 @@ rtems_status_code rtems_blkdev_create( void *driver_data ) { - rtems_status_code sc = RTEMS_SUCCESSFUL; - rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx)); + rtems_status_code sc; + rtems_blkdev_imfs_context *ctx; + + sc = rtems_bdbuf_init(); + if (sc != RTEMS_SUCCESSFUL) { + return RTEMS_INCORRECT_STATE; + } + ctx = malloc(sizeof(*ctx)); if (ctx != NULL) { sc = rtems_disk_init_phys( &ctx->dd, |