Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d25360b1 authored by Mohammed Shafi Shajakhan's avatar Mohammed Shafi Shajakhan Committed by John W. Linville
Browse files

ath9k: Fix modal EEPROM dump



we provide excess buffer size for 'simple_read_from_buffer'
for modal EEPROM dump. This results in trailing NULL bytes
at the end of EEPROM dump, fix this.

Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Reported-by: default avatarHolger Schurig <holgerschurig@googlemail.com>
Signed-off-by: default avatarMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Tested-by: default avatarHolger Schurig <holgerschurig@gogglemail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1dacd198
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3412,11 +3412,11 @@ static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
	if (!dump_base_hdr) {
	if (!dump_base_hdr) {
		len += snprintf(buf + len, size - len,
		len += snprintf(buf + len, size - len,
				"%20s :\n", "2GHz modal Header");
				"%20s :\n", "2GHz modal Header");
		len += ar9003_dump_modal_eeprom(buf, len, size,
		len = ar9003_dump_modal_eeprom(buf, len, size,
						&eep->modalHeader2G);
						&eep->modalHeader2G);
		len += snprintf(buf + len, size - len,
		len += snprintf(buf + len, size - len,
				"%20s :\n", "5GHz modal Header");
				"%20s :\n", "5GHz modal Header");
		len += ar9003_dump_modal_eeprom(buf, len, size,
		len = ar9003_dump_modal_eeprom(buf, len, size,
						&eep->modalHeader5G);
						&eep->modalHeader5G);
		goto out;
		goto out;
	}
	}
+1 −1
Original line number Original line Diff line number Diff line
@@ -135,7 +135,7 @@ static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
	if (!dump_base_hdr) {
	if (!dump_base_hdr) {
		len += snprintf(buf + len, size - len,
		len += snprintf(buf + len, size - len,
				"%20s :\n", "2GHz modal Header");
				"%20s :\n", "2GHz modal Header");
		len += ath9k_dump_4k_modal_eeprom(buf, len, size,
		len = ath9k_dump_4k_modal_eeprom(buf, len, size,
						  &eep->modalHeader);
						  &eep->modalHeader);
		goto out;
		goto out;
	}
	}
+1 −1
Original line number Original line Diff line number Diff line
@@ -132,7 +132,7 @@ static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
	if (!dump_base_hdr) {
	if (!dump_base_hdr) {
		len += snprintf(buf + len, size - len,
		len += snprintf(buf + len, size - len,
				"%20s :\n", "2GHz modal Header");
				"%20s :\n", "2GHz modal Header");
		len += ar9287_dump_modal_eeprom(buf, len, size,
		len = ar9287_dump_modal_eeprom(buf, len, size,
						&eep->modalHeader);
						&eep->modalHeader);
		goto out;
		goto out;
	}
	}
+2 −2
Original line number Original line Diff line number Diff line
@@ -211,11 +211,11 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
	if (!dump_base_hdr) {
	if (!dump_base_hdr) {
		len += snprintf(buf + len, size - len,
		len += snprintf(buf + len, size - len,
				"%20s :\n", "2GHz modal Header");
				"%20s :\n", "2GHz modal Header");
		len += ath9k_def_dump_modal_eeprom(buf, len, size,
		len = ath9k_def_dump_modal_eeprom(buf, len, size,
						   &eep->modalHeader[0]);
						   &eep->modalHeader[0]);
		len += snprintf(buf + len, size - len,
		len += snprintf(buf + len, size - len,
				"%20s :\n", "5GHz modal Header");
				"%20s :\n", "5GHz modal Header");
		len += ath9k_def_dump_modal_eeprom(buf, len, size,
		len = ath9k_def_dump_modal_eeprom(buf, len, size,
						   &eep->modalHeader[1]);
						   &eep->modalHeader[1]);
		goto out;
		goto out;
	}
	}