Selaa lähdekoodia

qcacmn: Do not try to delete a peer if already deleted

Currently if any layer tries to delete a peer which
has already been deleted, there is no check to stop
the delete operation. Deleting an already deleted peer
is incorrect.

Check if the peer is valid before we try to delete
the peer.

Change-Id: Icc280554a652e0ee3f1ea38c98fb130ea3c1ae80
CRs-Fixed: 2613595
Rakesh Pillai 5 vuotta sitten
vanhempi
sitoutus
fc60b6d73b
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      dp/wifi3.0/dp_main.c

+ 6 - 0
dp/wifi3.0/dp_main.c

@@ -6446,6 +6446,12 @@ static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc, uint8_t vdev_id,
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	if (!peer->valid) {
+		dp_peer_unref_delete(peer);
+		dp_err("Invalid peer: %pM", peer_mac);
+		return QDF_STATUS_E_ALREADY;
+	}
+
 	peer->valid = 0;
 
 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH,