Skip to content

Commit 63f6982

Browse files
Colin Ian KingKalle Valo
authored andcommitted
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: 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]
1 parent fada093 commit 63f6982

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/wireless/quantenna/qtnfmac/commands.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ int qtnf_cmd_send_del_intf(struct qtnf_vif *vif)
869869
default:
870870
pr_warn("VIF%u.%u: unsupported iftype %d\n", vif->mac->macid,
871871
vif->vifid, vif->wdev.iftype);
872+
dev_kfree_skb(cmd_skb);
872873
ret = -EINVAL;
873874
goto out;
874875
}
@@ -1924,6 +1925,7 @@ int qtnf_cmd_send_change_sta(struct qtnf_vif *vif, const u8 *mac,
19241925
break;
19251926
default:
19261927
pr_err("unsupported iftype %d\n", vif->wdev.iftype);
1928+
dev_kfree_skb(cmd_skb);
19271929
ret = -EINVAL;
19281930
goto out;
19291931
}

0 commit comments

Comments
 (0)