diff options
author | Dmitry Lebed <dlebed@quantenna.com> | 2018-05-29 15:00:02 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-05-30 22:20:06 +0300 |
commit | b60769e2dff0b168dfe3f03fe0d1950963c3c3da (patch) | |
tree | cd867181c6f8db806af2c77992a2728a7608f6fd | |
parent | 9e33e7fb47728cb53dbba09415d95d3ce0ea1ce4 (diff) | |
download | linux-b60769e2dff0b168dfe3f03fe0d1950963c3c3da.tar.xz |
qtnfmac: fix firmware command error path
Free command skb if bus state is not QTNF_FW_STATE_ACTIVE.
Signed-off-by: Dmitry Lebed <dlebed@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/quantenna/qtnfmac/commands.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/quantenna/qtnfmac/trans.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 9dc4560be5d8..e2fc57be1cdd 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -102,6 +102,7 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, pr_warn("VIF%u.%u: drop cmd 0x%.4X in fw state %d\n", mac_id, vif_id, le16_to_cpu(cmd->cmd_id), bus->fw_state); + dev_kfree_skb(cmd_skb); return -ENODEV; } diff --git a/drivers/net/wireless/quantenna/qtnfmac/trans.c b/drivers/net/wireless/quantenna/qtnfmac/trans.c index ccddfebc508a..345f34ec9750 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/trans.c +++ b/drivers/net/wireless/quantenna/qtnfmac/trans.c @@ -35,8 +35,10 @@ int qtnf_trans_send_cmd_with_resp(struct qtnf_bus *bus, struct sk_buff *cmd_skb, bool resp_not_handled = true; struct sk_buff *resp_skb = NULL; - if (unlikely(!response_skb)) + if (unlikely(!response_skb)) { + dev_kfree_skb(cmd_skb); return -EFAULT; + } spin_lock(&ctl_node->resp_lock); ctl_node->seq_num++; |