Bladeren bron

qcacld-3.0: add pointer 'vdev' null check in TXRX module

Add pointer 'vdev' null check for KW issue. In ol_tx_non_std()
when 'vdev' is null, return the pointer of msdu buffer.

Change-Id: Ic82db8c649de09dda42ae588bda7e58c036ae161
CRs-Fixed: 2645407
Rongjing Liao 5 jaren geleden
bovenliggende
commit
5806e9951f
2 gewijzigde bestanden met toevoegingen van 14 en 3 verwijderingen
  1. 9 3
      core/dp/txrx/ol_tx.h
  2. 5 0
      core/dp/txrx/ol_tx_hl.c

+ 9 - 3
core/dp/txrx/ol_tx.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -185,7 +185,10 @@ ol_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
 
 	vdev = (struct ol_txrx_vdev_t *)ol_txrx_get_vdev_from_vdev_id(vdev_id);
 
-	return ol_tx_non_std_hl(vdev, tx_spec, msdu_list);
+	if (!vdev)
+		return msdu_list;
+	else
+		return ol_tx_non_std_hl(vdev, tx_spec, msdu_list);
 }
 #else
 qdf_nbuf_t ol_tx_non_std_ll(struct ol_txrx_vdev_t *vdev,
@@ -199,7 +202,10 @@ ol_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
 
 	vdev = (struct ol_txrx_vdev_t *)ol_txrx_get_vdev_from_vdev_id(vdev_id);
 
-	return ol_tx_non_std_ll(vdev, tx_spec, msdu_list);
+	if (!vdev)
+		return msdu_list;
+	else
+		return ol_tx_non_std_ll(vdev, tx_spec, msdu_list);
 }
 #endif
 

+ 5 - 0
core/dp/txrx/ol_tx_hl.c

@@ -1911,6 +1911,11 @@ ol_txrx_hl_tdls_flag_reset(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
 {
 	struct ol_txrx_vdev_t *vdev =
 		(struct ol_txrx_vdev_t *)ol_txrx_get_vdev_from_vdev_id(vdev_id);
+	if (!vdev) {
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			  "%s: Invalid vdev_id %d", __func__, vdev_id);
+		return;
+	}
 
 	vdev->hlTdlsFlag = flag;
 }