Commit 63f69820 authored by Colin Ian King's avatar Colin Ian King Committed by Kalle Valo

qtnfmac: fix resource leaks on unsupported iftype error return path

Currently if an unsupported iftype is detected the error return path
does not free the cmd_skb leading to a resource leak. Fix this by
free'ing cmd_skb.

Addresses-Coverity: ("Resource leak")
Fixes: 805b28c0 ("qtnfmac: prepare for AP_VLAN interface type support")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200925132224.21638-1-colin.king@canonical.com
parent fada0931
...@@ -869,6 +869,7 @@ int qtnf_cmd_send_del_intf(struct qtnf_vif *vif) ...@@ -869,6 +869,7 @@ int qtnf_cmd_send_del_intf(struct qtnf_vif *vif)
default: default:
pr_warn("VIF%u.%u: unsupported iftype %d\n", vif->mac->macid, pr_warn("VIF%u.%u: unsupported iftype %d\n", vif->mac->macid,
vif->vifid, vif->wdev.iftype); vif->vifid, vif->wdev.iftype);
dev_kfree_skb(cmd_skb);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
...@@ -1924,6 +1925,7 @@ int qtnf_cmd_send_change_sta(struct qtnf_vif *vif, const u8 *mac, ...@@ -1924,6 +1925,7 @@ int qtnf_cmd_send_change_sta(struct qtnf_vif *vif, const u8 *mac,
break; break;
default: default:
pr_err("unsupported iftype %d\n", vif->wdev.iftype); pr_err("unsupported iftype %d\n", vif->wdev.iftype);
dev_kfree_skb(cmd_skb);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
......
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