Skip to content

Commit

Permalink
qtnfmac: fix resource leaks on unsupported iftype error return path
Browse files Browse the repository at this point in the history
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: 805b28c ("qtnfmac: prepare for AP_VLAN interface type support")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
Colin Ian King authored and Kalle Valo committed Sep 29, 2020
1 parent fada093 commit 63f6982
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/quantenna/qtnfmac/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ int qtnf_cmd_send_del_intf(struct qtnf_vif *vif)
default:
pr_warn("VIF%u.%u: unsupported iftype %d\n", vif->mac->macid,
vif->vifid, vif->wdev.iftype);
dev_kfree_skb(cmd_skb);
ret = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -1924,6 +1925,7 @@ int qtnf_cmd_send_change_sta(struct qtnf_vif *vif, const u8 *mac,
break;
default:
pr_err("unsupported iftype %d\n", vif->wdev.iftype);
dev_kfree_skb(cmd_skb);
ret = -EINVAL;
goto out;
}
Expand Down

0 comments on commit 63f6982

Please sign in to comment.