From b0d29c4764186704dc4e25e434ef219e2ab0f638 Mon Sep 17 00:00:00 2001 From: Min Liu Date: Thu, 10 Sep 2020 17:48:41 +0800 Subject: [PATCH] qcacmn: Add NULL pointer check for reg_rx_ops Add NULL pointer check for reg_rx_ops of regulatory component. Change-Id: If0917361f900d299fa9da519449781459c49ad17 CRs-Fixed: 2773937 --- target_if/regulatory/src/target_if_reg_11d.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target_if/regulatory/src/target_if_reg_11d.c b/target_if/regulatory/src/target_if_reg_11d.c index c857868d380b..3d7c3d886baf 100644 --- a/target_if/regulatory/src/target_if_reg_11d.c +++ b/target_if/regulatory/src/target_if_reg_11d.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -35,8 +35,8 @@ bool tgt_if_regulatory_is_11d_offloaded(struct wlan_objmgr_psoc *psoc) if (!wmi_handle) return false; - if (reg_rx_ops->reg_ignore_fw_reg_offload_ind && - reg_rx_ops->reg_ignore_fw_reg_offload_ind(psoc)) { + if (reg_rx_ops && reg_rx_ops->reg_ignore_fw_reg_offload_ind && + reg_rx_ops->reg_ignore_fw_reg_offload_ind(psoc)) { target_if_debug("Ignore fw reg 11d offload indication"); return 0; } @@ -71,7 +71,7 @@ static int tgt_reg_11d_new_cc_handler(ol_scn_t handle, uint8_t *event_buf, reg_rx_ops = target_if_regulatory_get_rx_ops(psoc); - if (!reg_rx_ops->reg_11d_new_cc_handler) { + if (!reg_rx_ops || !reg_rx_ops->reg_11d_new_cc_handler) { target_if_err("reg_11d_new_cc_handler is NULL"); return -EINVAL; }