summaryrefslogtreecommitdiff
path: root/core/utils
diff options
context:
space:
mode:
authorYuanyuan Liu <yuanliu@codeaurora.org>2016-06-06 09:38:04 -0700
committerAkash Patel <akashp@codeaurora.org>2016-06-09 22:14:39 -0700
commit9736118d7e9c840fbac7d312bb21c514423274cf (patch)
tree0495e2ceab4875602dcda8cb483a76ab4fd28aee /core/utils
parent50da82602164a9e349e1b74ab6da4a08763d5305 (diff)
qcacld-3.0: Add NULL check for qdf_ctx
Add NULL check for pointer qdf_ctx as it returned from call to function 'cds_get_context' may be NULL and could be dereferenced. Change-Id: Iea44cd1a2d20ee04d1720c4e8af1065320a589fd CRs-Fixed: 1024778
Diffstat (limited to 'core/utils')
-rw-r--r--core/utils/epping/src/epping_txrx.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/utils/epping/src/epping_txrx.c b/core/utils/epping/src/epping_txrx.c
index de26036c47ba..66364e290e43 100644
--- a/core/utils/epping/src/epping_txrx.c
+++ b/core/utils/epping/src/epping_txrx.c
@@ -229,6 +229,12 @@ static void epping_stop_adapter(epping_adapter_t *pAdapter)
{
qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
+ if (!qdf_ctx) {
+ EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
+ "%s: qdf_ctx is NULL\n", __func__);
+ return;
+ }
+
if (pAdapter && pAdapter->started) {
EPPING_LOG(LOG1, FL("Disabling queues"));
netif_tx_disable(pAdapter->dev);
@@ -243,10 +249,16 @@ static int epping_start_adapter(epping_adapter_t *pAdapter)
{
qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
+ if (!qdf_ctx) {
+ EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
+ "%s: qdf_ctx is NULL", __func__);
+ return -EINVAL;
+ }
+
if (!pAdapter) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: pAdapter= NULL\n", __func__);
- return -1;
+ return -EINVAL;
}
if (!pAdapter->started) {
pld_request_bus_bandwidth(qdf_ctx->dev,