Prechádzať zdrojové kódy

Merge "qcacld-3.0: Prevent possible NULL pointer dereference" into wlan-cld3.driver.lnx.2.0

CNSS_WLAN Service 5 rokov pred
rodič
commit
804c8208dd
1 zmenil súbory, kde vykonal 6 pridanie a 0 odobranie
  1. 6 0
      core/wma/src/wma_features.c

+ 6 - 0
core/wma/src/wma_features.c

@@ -2422,6 +2422,11 @@ static int wma_wake_event_piggybacked(
 	}
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+	if (!pdev) {
+		WMA_LOGE("Invalid pdev");
+		return -EINVAL;
+	}
+
 	bssid = wma_get_vdev_bssid
 		(wma->interfaces[event_param->fixed_param->vdev_id].vdev);
 	if (!bssid) {
@@ -2429,6 +2434,7 @@ static int wma_wake_event_piggybacked(
 			 __func__, event_param->fixed_param->vdev_id);
 		return 0;
 	}
+
 	peer = cdp_peer_find_by_addr(soc, pdev, bssid, &peer_id);
 	wake_reason = event_param->fixed_param->wake_reason;