qcacmn: Avoid NULL pointer dereference

Avoid NULL pointer dereference in wlan_crypto_fils_delkey()

Change-Id: I2425365f7e118b5ec72223905ce7d16437ee714d
CRs-Fixed: 2221348
This commit is contained in:
Subrat Mishra 2018-04-10 10:08:09 +05:30 • committed by nshrivas
commit 65817ac2d7

View file

@ -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