Explorar el Código

qcacld-3.0: Add Null check for soc before accessing

Check if the soc pointer is not NULL, before we
try to derefernce this pointer.

Change-Id: Ife499e7617365278c4ac8fd41e2ce32d4e19fae9
CRs-Fixed: 2702127
Rakesh Pillai hace 4 años
padre
commit
efb077864e
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      core/hdd/src/wlan_hdd_tx_rx.c

+ 3 - 0
core/hdd/src/wlan_hdd_tx_rx.c

@@ -2044,6 +2044,9 @@ QDF_STATUS hdd_rx_flush_packet_cbk(void *adapter_context, uint8_t vdev_id)
 	struct hdd_context *hdd_ctx;
 	ol_txrx_soc_handle soc = cds_get_context(QDF_MODULE_ID_SOC);
 
+	if (qdf_unlikely(!soc))
+		return QDF_STATUS_E_FAILURE;
+
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	if (unlikely(!hdd_ctx)) {
 		QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,