staging: wilc1000: use random number for cookie instead of pointer
authorAjay Singh <ajay.kathat@microchip.com>
Tue, 5 Feb 2019 07:15:42 +0000 (07:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Feb 2019 12:31:20 +0000 (13:31 +0100)
Use random number to assign to cookie value.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index f719b74..98121ec 100644 (file)
@@ -1252,7 +1252,7 @@ static int mgmt_tx(struct wiphy *wiphy,
        u32 buf_len = len + sizeof(p2p_vendor_spec) + sizeof(priv->p2p.local_random);
        int ret = 0;
 
-       *cookie = (unsigned long)buf;
+       *cookie = prandom_u32();
        priv->tx_cookie = *cookie;
        mgmt = (const struct ieee80211_mgmt *)buf;