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

Commit 0ff1bd35 authored by Richard A. Griffiths's avatar Richard A. Griffiths Committed by Johannes Berg
Browse files

iwlwifi: disallow log_event access if interface down



'echo 1 > log_event' generates the bogus "MAC is in deep sleep"
or "Timeout waiting for hardware access" log messages when
the interface is down, we should just disallow accessing the
device through debugfs when it is down.

Signed-off-by: default avatarRichard A. Griffiths <richardx.a.griffiths@intel.com>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent bd408b33
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2254,6 +2254,10 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
	char buf[8];
	int buf_size;

	/* check that the interface is up */
	if (!iwl_is_ready(priv))
		return -EAGAIN;

	memset(buf, 0, sizeof(buf));
	buf_size = min(count, sizeof(buf) -  1);
	if (copy_from_user(buf, user_buf, buf_size))