diff --git a/ftm/core/src/wlan_ftm_svc.c b/ftm/core/src/wlan_ftm_svc.c index a055642a13..9d25b18005 100644 --- a/ftm/core/src/wlan_ftm_svc.c +++ b/ftm/core/src/wlan_ftm_svc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -35,10 +35,8 @@ static QDF_STATUS ftm_pdev_obj_init(struct wifi_ftm_pdev_priv_obj *ftm_pdev_obj) { ftm_pdev_obj->data = qdf_mem_malloc(FTM_CMD_MAX_BUF_LENGTH); - if (!ftm_pdev_obj->data) { - ftm_err("Memory alloc failed for ftm pdev obj data"); + if (!ftm_pdev_obj->data) return QDF_STATUS_E_NOMEM; - } ftm_pdev_obj->length = 0; @@ -55,10 +53,8 @@ wlan_ftm_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev, ftm_pdev_obj = qdf_mem_malloc(sizeof(*ftm_pdev_obj)); - if (!ftm_pdev_obj) { - ftm_err("Memory alloc failed for ftm pdev obj"); + if (!ftm_pdev_obj) return QDF_STATUS_E_NOMEM; - } ftm_pdev_obj->pdev = pdev; status = ftm_pdev_obj_init(ftm_pdev_obj); diff --git a/utils/epping/src/epping_helper.c b/utils/epping/src/epping_helper.c index dbbfc4d9db..b8317ccd16 100644 --- a/utils/epping/src/epping_helper.c +++ b/utils/epping/src/epping_helper.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -53,12 +53,8 @@ int epping_cookie_init(epping_context_t *pEpping_ctx) pEpping_ctx->s_cookie_mem[i] = qdf_mem_malloc(sizeof(struct epping_cookie) * MAX_COOKIE_SLOT_SIZE); - if (pEpping_ctx->s_cookie_mem[i] == NULL) { - EPPING_LOG(QDF_TRACE_LEVEL_FATAL, - "%s: no mem for cookie (idx = %d)", __func__, - i); + if (!pEpping_ctx->s_cookie_mem[i]) goto error; - } } qdf_spinlock_create(&pEpping_ctx->cookie_lock); diff --git a/utils/epping/src/epping_main.c b/utils/epping/src/epping_main.c index 11d71faa27..cb73d633a9 100644 --- a/utils/epping/src/epping_main.c +++ b/utils/epping/src/epping_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -81,11 +81,8 @@ int epping_open(void) g_epping_ctx = qdf_mem_malloc(sizeof(*g_epping_ctx)); - if (g_epping_ctx == NULL) { - EPPING_LOG(QDF_TRACE_LEVEL_ERROR, - "%s: cannot alloc epping context", __func__); + if (!g_epping_ctx) return -ENOMEM; - } g_epping_ctx->con_mode = cds_get_conparam(); return 0; diff --git a/utils/host_diag_log/src/host_diag_log.c b/utils/host_diag_log/src/host_diag_log.c index 32fcef122e..97e51f6542 100644 --- a/utils/host_diag_log/src/host_diag_log.c +++ b/utils/host_diag_log/src/host_diag_log.c @@ -126,11 +126,8 @@ void host_diag_log_submit(void *plog_hdr_ptr) pBuf = (uint8_t *) qdf_mem_malloc(total_len); - if (!pBuf) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "qdf_mem_malloc failed"); + if (!pBuf) return; - } wmsg = (tAniHdr *) pBuf; wmsg->type = PTT_MSG_DIAG_CMDS_TYPE; @@ -219,11 +216,9 @@ void host_diag_event_report_payload(uint16_t event_Id, uint16_t length, pBuf = (uint8_t *) qdf_mem_malloc(total_len); - if (!pBuf) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "qdf_mem_malloc failed"); + if (!pBuf) return; - } + wmsg = (tAniHdr *) pBuf; wmsg->type = PTT_MSG_DIAG_CMDS_TYPE; wmsg->length = total_len;