summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorZxy <[email protected]>2023-03-23 12:56:38 +0800
committerMan, Jianting (Meco) <[email protected]>2023-03-23 01:55:21 -0400
commit156fda61cf96697b10a1e99b9c2d150090e58230 (patch)
tree1b0992f9cdda9c4fba97b2db6cc205dbbcc11e5c /components
parent4ed9bc11f71fe231bc673a9b1deb2ff5354129bc (diff)
[errno code]fix that use RT_ENOMEM without -
Diffstat (limited to 'components')
-rw-r--r--components/drivers/ipc/dataqueue.c2
-rw-r--r--components/drivers/usb/usbhost/core/usbhost_core.c4
-rw-r--r--components/utilities/ymodem/ry_sy.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/components/drivers/ipc/dataqueue.c b/components/drivers/ipc/dataqueue.c
index 03e685a6bf..2222539cdf 100644
--- a/components/drivers/ipc/dataqueue.c
+++ b/components/drivers/ipc/dataqueue.c
@@ -36,7 +36,7 @@ struct rt_data_item
* @param evt_notify is the notification callback function.
*
* @return Return the operation status. When the return value is RT_EOK, the initialization is successful.
- * When the return value is RT_ENOMEM, it means insufficient memory allocation failed.
+ * When the return value is -RT_ENOMEM, it means insufficient memory allocation failed.
*/
rt_err_t
rt_data_queue_init(struct rt_data_queue *queue,
diff --git a/components/drivers/usb/usbhost/core/usbhost_core.c b/components/drivers/usb/usbhost/core/usbhost_core.c
index 6f570cc784..cef1600433 100644
--- a/components/drivers/usb/usbhost/core/usbhost_core.c
+++ b/components/drivers/usb/usbhost/core/usbhost_core.c
@@ -164,7 +164,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
device->cfg_desc = (ucfg_desc_t)rt_malloc(cfg_desc.wTotalLength);
if(device->cfg_desc == RT_NULL)
{
- return RT_ENOMEM;
+ return -RT_ENOMEM;
}
rt_memset(device->cfg_desc, 0, cfg_desc.wTotalLength);
@@ -225,7 +225,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
device->intf[i] = (struct uhintf*)rt_malloc(sizeof(struct uhintf));
if(device->intf[i] == RT_NULL)
{
- return RT_ENOMEM;
+ return -RT_ENOMEM;
}
device->intf[i]->drv = drv;
device->intf[i]->device = device;
diff --git a/components/utilities/ymodem/ry_sy.c b/components/utilities/ymodem/ry_sy.c
index c6117a53ef..557d4bcdab 100644
--- a/components/utilities/ymodem/ry_sy.c
+++ b/components/utilities/ymodem/ry_sy.c
@@ -199,7 +199,7 @@ static rt_err_t rym_download_file(rt_device_t idev,const char *file_path)
if (!ctx)
{
rt_kprintf("rt_malloc failed\n");
- return RT_ENOMEM;
+ return -RT_ENOMEM;
}
ctx->fd = -1;
rt_strncpy(ctx->fpath, file_path, DFS_PATH_MAX);
@@ -219,7 +219,7 @@ static rt_err_t rym_upload_file(rt_device_t idev, const char *file_path)
if (!ctx)
{
rt_kprintf("rt_malloc failed\n");
- return RT_ENOMEM;
+ return -RT_ENOMEM;
}
ctx->fd = -1;
rt_strncpy(ctx->fpath, file_path, DFS_PATH_MAX);