summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Agarwal <himanaga@codeaurora.org>2017-08-09 12:48:39 +0530
committersnandini <snandini@codeaurora.org>2017-08-13 23:38:16 -0700
commit5cbc6e6adb6df9a55fcf09fc51ccd0f2bf2d215f (patch)
tree5d6be330bcb0fb9133c10ba5091e404d0dda1f1f
parent007cb303e9d00534fa9bb04c7659f5fd72d7c52f (diff)
qcacld-3.0: Add NULL checks before use
Add NULL checks for variables before using them in functions. Change-Id: I9b10daf6678451860d3fe0bea2d830cfb7c5fd95 CRs-Fixed: 2089858
-rw-r--r--core/dp/htt/htt_tx.c2
-rw-r--r--core/hdd/src/wlan_hdd_driver_ops.c2
-rw-r--r--core/hdd/src/wlan_hdd_ipa.c23
3 files changed, 25 insertions, 2 deletions
diff --git a/core/dp/htt/htt_tx.c b/core/dp/htt/htt_tx.c
index 9793beb29949..90a6204819f3 100644
--- a/core/dp/htt/htt_tx.c
+++ b/core/dp/htt/htt_tx.c
@@ -1237,7 +1237,7 @@ static int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
tx_buffer_count < (uc_tx_buf_cnt - 1); tx_buffer_count++) {
shared_tx_buffer = qdf_mem_shared_mem_alloc(pdev->osdev,
uc_tx_buf_sz);
- if (!!shared_tx_buffer || !shared_tx_buffer->vaddr) {
+ if (!shared_tx_buffer || !shared_tx_buffer->vaddr) {
qdf_print("%s: TX BUF alloc fail, loop index: %d",
__func__, tx_buffer_count);
tx_buffer_count_pwr2 = tx_buffer_count;
diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c
index ad4c653e2957..a298195c297f 100644
--- a/core/hdd/src/wlan_hdd_driver_ops.c
+++ b/core/hdd/src/wlan_hdd_driver_ops.c
@@ -316,6 +316,7 @@ static void hdd_init_qdf_ctx(struct device *dev, void *bdev,
qdf_dev->drv_hdl = bdev;
qdf_dev->bus_type = bus_type;
qdf_dev->bid = bid;
+ cds_smmu_mem_map_setup(qdf_dev);
}
/**
@@ -356,7 +357,6 @@ static int wlan_hdd_probe(struct device *dev, void *bdev, const struct hif_bus_i
cds_set_load_in_progress(true);
hdd_init_qdf_ctx(dev, bdev, bus_type, (const struct hif_bus_id *)bid);
- cds_smmu_mem_map_setup(cds_get_context(QDF_MODULE_ID_QDF_DEVICE));
if (reinit) {
ret = hdd_wlan_re_init();
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index a626b8044885..b4e7a979af1d 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -2112,6 +2112,13 @@ static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt)
return;
}
+ if (!osdev) {
+ HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL,
+ "%s: qdf dev context is NULL", __func__);
+ qdf_mem_free(op_msg);
+ return;
+ }
+
hdd_ctx = (hdd_context_t *) usr_ctxt;
/*
@@ -2731,6 +2738,14 @@ QDF_STATUS hdd_ipa_uc_ol_init(hdd_context_t *hdd_ctx)
return stat;
ENTER();
+
+ if (!osdev) {
+ HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL,
+ "%s: qdf dev context is NULL", __func__);
+ stat = QDF_STATUS_E_INVAL;
+ goto fail_return;
+ }
+
/* Do only IPA Pipe specific configuration here. All one time
* initialization wrt IPA UC shall in hdd_ipa_init and those need
* to be reinit at SSR shall in be SSR deinit / reinit functions.
@@ -2985,6 +3000,14 @@ QDF_STATUS hdd_ipa_uc_ol_init(hdd_context_t *hdd_ctx)
return stat;
ENTER();
+
+ if (!osdev) {
+ HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL,
+ "%s: qdf dev context is NULL", __func__);
+ stat = QDF_STATUS_E_INVAL;
+ goto fail_return;
+ }
+
/* Do only IPA Pipe specific configuration here. All one time
* initialization wrt IPA UC shall in hdd_ipa_init and those need
* to be reinit at SSR shall in be SSR deinit / reinit functions.