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

Commit 62b4fb66 authored by Sujith's avatar Sujith Committed by John W. Linville
Browse files

ath9k: Fix bug in reading debugfs file 'rcstat'



The rate table would not have been chosen before the interface
has been brought up. Reading 'rcstat' in this case would result
in an oops, fix this.

Signed-off-by: default avatarSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c37452b0
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -322,6 +322,9 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
{
{
	struct ath_softc *sc = file->private_data;
	struct ath_softc *sc = file->private_data;


	if (sc->cur_rate_table == NULL)
		return 0;

	if (conf_is_ht(&sc->hw->conf))
	if (conf_is_ht(&sc->hw->conf))
		return ath_read_file_stat_11n_rc(file, user_buf, count, ppos);
		return ath_read_file_stat_11n_rc(file, user_buf, count, ppos);
	else
	else