diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2026-05-12 22:34:28 +0300 |
|---|---|---|
| committer | Miri Korenblit <miriam.rachel.korenblit@intel.com> | 2026-05-26 15:17:11 +0300 |
| commit | 764a3a1b421f8d4c53c8269bab0decf511acd4f0 (patch) | |
| tree | 39c21a3ffcc36eeb43fb303d364994cc6e6c982a /drivers | |
| parent | e2323929a68af099481cf13dd37038fa12647bd4 (diff) | |
wifi: iwlwifi: tighten flags in debugfs command sending
The only flags that could reasonably be used here are
CMD_WANT_SKB and CMD_ASYNC, CMD_SEND_IN_RFKILL doesn't
really make sense and CMD_BLOCK_TXQS just triggers a
warning, as does CMD_WANT_SKB | CMD_ASYNC.
Clear CMD_WANT_SKB since the response SKB isn't used
anyway, and refuse flags other than CMD_ASYNC to avoid
the warnings or other issues.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20260512222731.71b8cda9c4e8.I0cccfd67675989b48d003833f5813c8fbded45a6@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/debugfs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c index ddee7c2deb36..f06978d5b5ee 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/debugfs.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* - * Copyright (C) 2012-2014, 2018-2024 Intel Corporation + * Copyright (C) 2012-2014, 2018-2024, 2026 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */ @@ -275,16 +275,19 @@ static ssize_t iwl_dbgfs_send_hcmd_write(struct iwl_fw_runtime *fwrt, char *buf, goto out; } + /* ignore this flag, we cannot use the response */ + hcmd.flags &= ~CMD_WANT_SKB; + /* reject flags other than async, they cannot be used this way */ + if (hcmd.flags & ~CMD_ASYNC) { + ret = -EINVAL; + goto out; + } + if (fwrt->ops && fwrt->ops->send_hcmd) ret = fwrt->ops->send_hcmd(fwrt->ops_ctx, &hcmd); else ret = -EPERM; - if (ret < 0) - goto out; - - if (hcmd.flags & CMD_WANT_SKB) - iwl_free_resp(&hcmd); out: kfree(data); return ret ?: count; |
