diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index 5b5046d0cf6c..bb2218ae674d 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -2253,10 +2253,8 @@ static int __iw_softap_get_channel_list(struct net_device *dev, hdd_enter_dev(dev); - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("Invalid adapter!!!"); + if (hdd_validate_adapter(adapter)) return -ENODEV; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c298f110e122..99e2893ea21d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -10214,10 +10214,8 @@ static void hdd_adapter_param_update_work(void *arg) WLAN_HDD_ADAPTER_OPS_WORK_SCHED, WLAN_INVALID_VDEV_ID); - if (hdd_validate_adapter(adapter)) { - hdd_err("netdev features update request for invalid adapter"); + if (hdd_validate_adapter(adapter)) return; - } errno = osif_vdev_sync_op_start(adapter->dev, &vdev_sync); if (errno) diff --git a/core/hdd/src/wlan_hdd_sysfs_crash_inject.c b/core/hdd/src/wlan_hdd_sysfs_crash_inject.c index 175e87a155eb..0d73cab249ba 100644 --- a/core/hdd/src/wlan_hdd_sysfs_crash_inject.c +++ b/core/hdd/src/wlan_hdd_sysfs_crash_inject.c @@ -36,10 +36,8 @@ static ssize_t __hdd_sysfs_crash_inject_store( uint32_t val1, val2; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_dcm.c b/core/hdd/src/wlan_hdd_sysfs_dcm.c index 546edb4061f7..53fd6119faa7 100644 --- a/core/hdd/src/wlan_hdd_sysfs_dcm.c +++ b/core/hdd/src/wlan_hdd_sysfs_dcm.c @@ -36,10 +36,8 @@ __wlan_hdd_sysfs_dcm_store(struct net_device *net_dev, char const *buf, char *sptr, *token; int value, ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -101,10 +99,8 @@ __wlan_hdd_sysfs_dcm_show(struct net_device *net_dev, char *buf) struct hdd_context *hdd_ctx; int ret, value; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_dl_modes.c b/core/hdd/src/wlan_hdd_sysfs_dl_modes.c index b166243d125c..01c0053b6d01 100644 --- a/core/hdd/src/wlan_hdd_sysfs_dl_modes.c +++ b/core/hdd/src/wlan_hdd_sysfs_dl_modes.c @@ -57,10 +57,8 @@ __hdd_sysfs_dl_loglevel_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -130,10 +128,8 @@ __hdd_sysfs_dl_mod_loglevel_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -203,10 +199,8 @@ __hdd_sysfs_dl_modoff_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -276,10 +270,8 @@ __hdd_sysfs_dl_modon_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -349,10 +341,8 @@ __hdd_sysfs_dl_report_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -422,10 +412,8 @@ __hdd_sysfs_dl_type_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -495,10 +483,8 @@ __hdd_sysfs_dl_vapoff_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -568,10 +554,8 @@ __hdd_sysfs_dl_vapon_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_gtx_bw_mask.c b/core/hdd/src/wlan_hdd_sysfs_gtx_bw_mask.c index 0abe6294566b..155e4e4405aa 100644 --- a/core/hdd/src/wlan_hdd_sysfs_gtx_bw_mask.c +++ b/core/hdd/src/wlan_hdd_sysfs_gtx_bw_mask.c @@ -72,10 +72,8 @@ __hdd_sysfs_gtx_bw_mask_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -143,10 +141,8 @@ __hdd_sysfs_gtx_bw_mask_show(struct net_device *net_dev, char *buf) struct hdd_context *hdd_ctx; int ret, value; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_he_bss_color.c b/core/hdd/src/wlan_hdd_sysfs_he_bss_color.c index 4312a8e3b44f..8d537dc9ffcf 100644 --- a/core/hdd/src/wlan_hdd_sysfs_he_bss_color.c +++ b/core/hdd/src/wlan_hdd_sysfs_he_bss_color.c @@ -37,10 +37,8 @@ __hdd_sysfs_he_bss_color_store(struct net_device *net_dev, QDF_STATUS status; int value, ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_modify_acl.c b/core/hdd/src/wlan_hdd_sysfs_modify_acl.c index 87af294d9ed7..b815af708416 100644 --- a/core/hdd/src/wlan_hdd_sysfs_modify_acl.c +++ b/core/hdd/src/wlan_hdd_sysfs_modify_acl.c @@ -41,10 +41,8 @@ static ssize_t __hdd_sysfs_modify_acl_store( int ret, i; QDF_STATUS qdf_status; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_monitor_mode_channel.c b/core/hdd/src/wlan_hdd_sysfs_monitor_mode_channel.c index 1c16f770e661..d0f585c91726 100644 --- a/core/hdd/src/wlan_hdd_sysfs_monitor_mode_channel.c +++ b/core/hdd/src/wlan_hdd_sysfs_monitor_mode_channel.c @@ -38,10 +38,8 @@ __hdd_sysfs_monitor_mode_channel_store(struct net_device *net_dev, uint32_t val1, val2; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_motion_detection.c b/core/hdd/src/wlan_hdd_sysfs_motion_detection.c index 889fa2b21420..f1644b13bb88 100644 --- a/core/hdd/src/wlan_hdd_sysfs_motion_detection.c +++ b/core/hdd/src/wlan_hdd_sysfs_motion_detection.c @@ -45,10 +45,8 @@ __hdd_sysfs_mt_bl_config_store(struct net_device *net_dev, uint32_t bl_time_t, bl_packet_gap, bl_n, bl_num_meas; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -142,10 +140,8 @@ __hdd_sysfs_mt_bl_start_store(struct net_device *net_dev, QDF_STATUS status; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -229,10 +225,8 @@ __hdd_sysfs_mt_config_store(struct net_device *net_dev, uint32_t val_32[HDD_SYSFS_MT_CONFIG_UINT32_ARGS]; int i, ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -325,10 +319,8 @@ __hdd_sysfs_mt_start_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_radar.c b/core/hdd/src/wlan_hdd_sysfs_radar.c index 9c65c9960f6a..ceb7ac4c00ae 100644 --- a/core/hdd/src/wlan_hdd_sysfs_radar.c +++ b/core/hdd/src/wlan_hdd_sysfs_radar.c @@ -40,10 +40,8 @@ __hdd_sysfs_radar_store(struct net_device *net_dev, int set_value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_range_ext.c b/core/hdd/src/wlan_hdd_sysfs_range_ext.c index a1b269d1d070..7deb97a39b87 100644 --- a/core/hdd/src/wlan_hdd_sysfs_range_ext.c +++ b/core/hdd/src/wlan_hdd_sysfs_range_ext.c @@ -34,10 +34,8 @@ __hdd_sysfs_range_ext_show(struct net_device *net_dev, char *buf) int value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -84,10 +82,8 @@ static ssize_t __hdd_sysfs_range_ext_store(struct net_device *net_dev, uint32_t value; int ret, errno; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_reassoc.c b/core/hdd/src/wlan_hdd_sysfs_reassoc.c index bdb2d7173bcf..b84e2a6ba450 100644 --- a/core/hdd/src/wlan_hdd_sysfs_reassoc.c +++ b/core/hdd/src/wlan_hdd_sysfs_reassoc.c @@ -39,10 +39,8 @@ __wlan_hdd_store_reassoc_sysfs(struct net_device *net_dev, char const *buf, tSirMacAddr bssid; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_rts_cts.c b/core/hdd/src/wlan_hdd_sysfs_rts_cts.c index f8037a35858a..766e541f4394 100644 --- a/core/hdd/src/wlan_hdd_sysfs_rts_cts.c +++ b/core/hdd/src/wlan_hdd_sysfs_rts_cts.c @@ -41,10 +41,8 @@ __hdd_sysfs_rts_cts_store(struct net_device *net_dev, QDF_STATUS status; int value, ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_stats.c b/core/hdd/src/wlan_hdd_sysfs_stats.c index 658dc92bce9b..285e0718ed76 100644 --- a/core/hdd/src/wlan_hdd_sysfs_stats.c +++ b/core/hdd/src/wlan_hdd_sysfs_stats.c @@ -113,10 +113,8 @@ __hdd_sysfs_stats_show(struct net_device *net_dev, char *buf) int ret; ssize_t length = 0; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -164,10 +162,8 @@ __wlan_hdd_sysfs_dump_stats_store(struct net_device *net_dev, char const *buf, char *sptr, *token; int value, ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -224,10 +220,8 @@ __wlan_hdd_sysfs_dump_stats_show(struct net_device *net_dev, char *buf) struct hdd_context *hdd_ctx; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -274,10 +268,8 @@ __wlan_hdd_sysfs_clear_stats_store(struct net_device *net_dev, char const *buf, char *sptr, *token; int value, ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_suspend_resume.c b/core/hdd/src/wlan_hdd_sysfs_suspend_resume.c index 24097ce2444f..f8fdb5944302 100644 --- a/core/hdd/src/wlan_hdd_sysfs_suspend_resume.c +++ b/core/hdd/src/wlan_hdd_sysfs_suspend_resume.c @@ -36,10 +36,8 @@ static ssize_t __hdd_sysfs_suspend_store( char *sptr, *token; int ret, pause_setting, resume_setting; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); @@ -135,10 +133,8 @@ static ssize_t __hdd_sysfs_resume_store( struct hdd_context *hdd_ctx; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_temperature.c b/core/hdd/src/wlan_hdd_sysfs_temperature.c index 12d2902badf7..41d84bf67d7c 100644 --- a/core/hdd/src/wlan_hdd_sysfs_temperature.c +++ b/core/hdd/src/wlan_hdd_sysfs_temperature.c @@ -34,10 +34,8 @@ __hdd_sysfs_temperature_show(struct net_device *net_dev, char *buf) int value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_tx_stbc.c b/core/hdd/src/wlan_hdd_sysfs_tx_stbc.c index 502ebb8d7018..a027b30bfa27 100644 --- a/core/hdd/src/wlan_hdd_sysfs_tx_stbc.c +++ b/core/hdd/src/wlan_hdd_sysfs_tx_stbc.c @@ -52,10 +52,8 @@ __hdd_sysfs_tx_stbc_show(struct net_device *net_dev, char *buf) int ret; int value; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_txrx_fw_st_rst.c b/core/hdd/src/wlan_hdd_sysfs_txrx_fw_st_rst.c index f1a3b1508e9f..28b0404effff 100644 --- a/core/hdd/src/wlan_hdd_sysfs_txrx_fw_st_rst.c +++ b/core/hdd/src/wlan_hdd_sysfs_txrx_fw_st_rst.c @@ -55,10 +55,8 @@ __hdd_sysfs_txrx_fw_st_rst_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_txrx_fw_stats.c b/core/hdd/src/wlan_hdd_sysfs_txrx_fw_stats.c index 12a8050d8fef..c14e562584ff 100644 --- a/core/hdd/src/wlan_hdd_sysfs_txrx_fw_stats.c +++ b/core/hdd/src/wlan_hdd_sysfs_txrx_fw_stats.c @@ -55,10 +55,8 @@ __hdd_sysfs_txrx_fw_stats_store(struct net_device *net_dev, uint32_t value; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_txrx_stats.c b/core/hdd/src/wlan_hdd_sysfs_txrx_stats.c index 1f8d39dbc9d6..b9727659302e 100644 --- a/core/hdd/src/wlan_hdd_sysfs_txrx_stats.c +++ b/core/hdd/src/wlan_hdd_sysfs_txrx_stats.c @@ -44,10 +44,8 @@ __hdd_sysfs_txrx_stats_store(struct net_device *net_dev, uint8_t val2; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_unit_test.c b/core/hdd/src/wlan_hdd_sysfs_unit_test.c index 963000f1d266..4da18b04eb60 100644 --- a/core/hdd/src/wlan_hdd_sysfs_unit_test.c +++ b/core/hdd/src/wlan_hdd_sysfs_unit_test.c @@ -43,10 +43,8 @@ static ssize_t __hdd_sysfs_unit_test_target_store( int module_id, args_num, ret, i; QDF_STATUS status; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_wowl_add_ptrn.c b/core/hdd/src/wlan_hdd_sysfs_wowl_add_ptrn.c index d44771350e64..587918973c37 100644 --- a/core/hdd/src/wlan_hdd_sysfs_wowl_add_ptrn.c +++ b/core/hdd/src/wlan_hdd_sysfs_wowl_add_ptrn.c @@ -38,10 +38,8 @@ __hdd_sysfs_wowl_add_ptrn_store(struct net_device *net_dev, char buf_local[MAX_SYSFS_USER_COMMAND_SIZE_LENGTH + 1]; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_sysfs_wowl_del_ptrn.c b/core/hdd/src/wlan_hdd_sysfs_wowl_del_ptrn.c index 699572f4be80..229078315971 100644 --- a/core/hdd/src/wlan_hdd_sysfs_wowl_del_ptrn.c +++ b/core/hdd/src/wlan_hdd_sysfs_wowl_del_ptrn.c @@ -36,10 +36,8 @@ __hdd_sysfs_wowl_del_ptrn_store(struct net_device *net_dev, char buf_local[MAX_SYSFS_USER_COMMAND_SIZE_LENGTH + 1]; int ret; - if (hdd_validate_adapter(adapter)) { - hdd_err_rl("adapter validate fail"); + if (hdd_validate_adapter(adapter)) return -EINVAL; - } hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index a783b0858f6d..4f59719232ff 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -2078,10 +2078,8 @@ QDF_STATUS hdd_rx_pkt_thread_enqueue_cbk(void *adapter, } hdd_adapter = (struct hdd_adapter *)adapter; - if (hdd_validate_adapter(hdd_adapter)) { - hdd_err_rl("adapter validate failed"); + if (hdd_validate_adapter(hdd_adapter)) return QDF_STATUS_E_FAILURE; - } vdev_id = hdd_adapter->vdev_id; head_ptr = nbuf_list; diff --git a/core/hdd/src/wlan_hdd_wmm.c b/core/hdd/src/wlan_hdd_wmm.c index be852db8679c..6e3cc6228887 100644 --- a/core/hdd/src/wlan_hdd_wmm.c +++ b/core/hdd/src/wlan_hdd_wmm.c @@ -2440,10 +2440,8 @@ bool hdd_wmm_is_acm_allowed(uint8_t vdev_id) } adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id); - if (hdd_validate_adapter(adapter)) { - hdd_err("Invalid adapter"); + if (hdd_validate_adapter(adapter)) return false; - } wmm_ac_status = adapter->hdd_wmm_status.ac_status;