Commit 70c9101d authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho

iwlwifi: warn on SKB free w/o op-mode

If this ever happens, and it looks like some code in PCIe is
a bit broken and might lead to this, we want to know without
crashing, so add a WARN_ON_ONCE().
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124418.a18b7443dc55.Ia29836738acf14a55af5504aba90c6fea9fff785@changeidSigned-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 3c21990b
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/* /*
* Copyright (C) 2005-2014, 2018-2020 Intel Corporation * Copyright (C) 2005-2014, 2018-2021 Intel Corporation
* Copyright (C) 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
* Copyright (C) 2015 Intel Deutschland GmbH * Copyright (C) 2015 Intel Deutschland GmbH
*/ */
...@@ -176,6 +176,8 @@ iwl_op_mode_hw_rf_kill(struct iwl_op_mode *op_mode, bool state) ...@@ -176,6 +176,8 @@ iwl_op_mode_hw_rf_kill(struct iwl_op_mode *op_mode, bool state)
static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode, static inline void iwl_op_mode_free_skb(struct iwl_op_mode *op_mode,
struct sk_buff *skb) struct sk_buff *skb)
{ {
if (WARN_ON_ONCE(!op_mode))
return;
op_mode->ops->free_skb(op_mode, skb); op_mode->ops->free_skb(op_mode, skb);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment