Răsfoiți Sursa

qcacmn: Avoid NULL pointer dereference

Avoid NULL pointer dereference in wlan_crypto_fils_delkey()

Change-Id: I2425365f7e118b5ec72223905ce7d16437ee714d
CRs-Fixed: 2221348
Subrat Mishra 7 ani în urmă
părinte
comite
65817ac2d7
1 a modificat fișierele cu 5 adăugiri și 4 ștergeri
  1. 5 4
      umac/cmn_services/crypto/src/wlan_crypto_fils.c

+ 5 - 4
umac/cmn_services/crypto/src/wlan_crypto_fils.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 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
@@ -429,9 +429,10 @@ void wlan_crypto_fils_delkey(struct wlan_objmgr_peer *peer)
 	}
 
 	key = crypto_priv->key[0];
-	if (key && key->private)
-		qdf_mem_free((struct wlan_crypto_fils_aad_key *)key->private);
-	key->private = 0;
+	if (key) {
+		qdf_mem_free(key->private);
+		key->private = NULL;
+	}
 }
 #else