staging: wilc1000: modified NULL check used for 'if' condition in delete_key()
authorAjay Singh <ajay.kathat@microchip.com>
Wed, 2 May 2018 07:13:29 +0000 (12:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 May 2018 20:56:34 +0000 (13:56 -0700)
Fix below issue reported by checkpatch.pl script.

'Comparison to NULL could be written "priv->wilc_gtk[key_index]"'
'Comparison to NULL could be written "priv->wilc_ptk[key_index]"'

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 d6401a0..25364d3 100644 (file)
@@ -1038,7 +1038,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
        wl = vif->wilc;
 
        if (netdev == wl->vif[0]->ndev) {
-               if (priv->wilc_gtk[key_index] != NULL) {
+               if (priv->wilc_gtk[key_index]) {
                        kfree(priv->wilc_gtk[key_index]->key);
                        priv->wilc_gtk[key_index]->key = NULL;
                        kfree(priv->wilc_gtk[key_index]->seq);
@@ -1048,7 +1048,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
                        priv->wilc_gtk[key_index] = NULL;
                }
 
-               if (priv->wilc_ptk[key_index] != NULL) {
+               if (priv->wilc_ptk[key_index]) {
                        kfree(priv->wilc_ptk[key_index]->key);
                        priv->wilc_ptk[key_index]->key = NULL;
                        kfree(priv->wilc_ptk[key_index]->seq);