Prechádzať zdrojové kódy

qcacld-3.0: Add null check before accessing soc

While selecting RX refill ring size soc is being
accessed without null check performed.
Add null check to avoid any invalid access.

Change-Id: If1111341b53903c4d00bb96da67af2f6b3cd2746
CRs-Fixed: 3642908
Karthik Kantamneni 1 rok pred
rodič
commit
8653d961c9
1 zmenil súbory, kde vykonal 6 pridanie a 0 odobranie
  1. 6 0
      core/dp/htt/htt_rx_ll.c

+ 6 - 0
core/dp/htt/htt_rx_ll.c

@@ -562,6 +562,12 @@ static int htt_rx_ring_size(struct htt_pdev_t *pdev)
 
 	size = qdf_get_pwr2(size);
 
+	if (!soc) {
+		QDF_TRACE(QDF_MODULE_ID_HTT, QDF_TRACE_LEVEL_ERROR,
+		  "Unable to get 2x2 cap soc is NULL ring size:%u selected ", size);
+		return size;
+	}
+
 	status = wlan_mlme_get_vht_enable2x2((void *)soc->psoc, &enable_2x2);
 	if (QDF_IS_STATUS_SUCCESS(status))
 		size = (enable_2x2) ? size : QDF_MIN(size, HTT_RX_RING_SIZE_1x1);