qcacld-3.0: Prevent null pointer dereference issue

Add null check for pdev after cds_get_context, while
retrieving the context maintained by CDS

Change-Id: I2d6de7d5ad2a46139b2594cf966f2c083c9bb4b4
CRs-Fixed: 2187396
This commit is contained in:
Alok Kumar 2018-02-09 16:01:06 +05:30 • committed by snandini
commit eff0d77da1

View file

@ -2650,6 +2650,11 @@ static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt)
struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
QDF_STATUS status = QDF_STATUS_SUCCESS;
if (!pdev) {
HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "pdev is NULL");
return;
}
if (!op_msg || !usr_ctxt) {
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "INVALID ARG");
return;