Search Linux Wireless

[PATCH 16/24] ath9k: remove !NULL check before kfree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kfree(NULL) works so remove all those branches which check
for it before kfree()'ing on ath9k_hw_rfdetach().

Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---
 drivers/net/wireless/ath/ath9k/phy.c |   62 ++++++++++++++-------------------
 1 files changed, 26 insertions(+), 36 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/phy.c b/drivers/net/wireless/ath/ath9k/phy.c
index aaa9415..06fd057 100644
--- a/drivers/net/wireless/ath/ath9k/phy.c
+++ b/drivers/net/wireless/ath/ath9k/phy.c
@@ -266,42 +266,32 @@ ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan,
 void
 ath9k_hw_rfdetach(struct ath_hw *ah)
 {
-	if (ah->analogBank0Data != NULL) {
-		kfree(ah->analogBank0Data);
-		ah->analogBank0Data = NULL;
-	}
-	if (ah->analogBank1Data != NULL) {
-		kfree(ah->analogBank1Data);
-		ah->analogBank1Data = NULL;
-	}
-	if (ah->analogBank2Data != NULL) {
-		kfree(ah->analogBank2Data);
-		ah->analogBank2Data = NULL;
-	}
-	if (ah->analogBank3Data != NULL) {
-		kfree(ah->analogBank3Data);
-		ah->analogBank3Data = NULL;
-	}
-	if (ah->analogBank6Data != NULL) {
-		kfree(ah->analogBank6Data);
-		ah->analogBank6Data = NULL;
-	}
-	if (ah->analogBank6TPCData != NULL) {
-		kfree(ah->analogBank6TPCData);
-		ah->analogBank6TPCData = NULL;
-	}
-	if (ah->analogBank7Data != NULL) {
-		kfree(ah->analogBank7Data);
-		ah->analogBank7Data = NULL;
-	}
-	if (ah->addac5416_21 != NULL) {
-		kfree(ah->addac5416_21);
-		ah->addac5416_21 = NULL;
-	}
-	if (ah->bank6Temp != NULL) {
-		kfree(ah->bank6Temp);
-		ah->bank6Temp = NULL;
-	}
+	kfree(ah->analogBank0Data);
+	ah->analogBank0Data = NULL;
+
+	kfree(ah->analogBank1Data);
+	ah->analogBank1Data = NULL;
+
+	kfree(ah->analogBank2Data);
+	ah->analogBank2Data = NULL;
+
+	kfree(ah->analogBank3Data);
+	ah->analogBank3Data = NULL;
+
+	kfree(ah->analogBank6Data);
+	ah->analogBank6Data = NULL;
+
+	kfree(ah->analogBank6TPCData);
+	ah->analogBank6TPCData = NULL;
+
+	kfree(ah->analogBank7Data);
+	ah->analogBank7Data = NULL;
+
+	kfree(ah->addac5416_21);
+	ah->addac5416_21 = NULL;
+
+	kfree(ah->bank6Temp);
+	ah->bank6Temp = NULL;
 }
 
 bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux