mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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>
This commit is contained in:
parent
e2323929a6
commit
764a3a1b42
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user