// 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
*/
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;