drivers/net/wireless/rsi/rsi_91x_mac80211.c:209:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci CC: Prameela Rani Garnepudi <prameela.j04cs@xxxxxxxxx> Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx> --- rsi_91x_mac80211.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -205,8 +205,7 @@ void rsi_mac80211_detach(struct rsi_hw * for(i = 0; i < 2; i++) { struct ieee80211_supported_band *sbands = &adapter->sbands[i]; - if (sbands->channels) - kfree(sbands->channels); + kfree(sbands->channels); } #ifdef CONFIG_RSI_DEBUGFS