Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ed760c9 authored by Arend Van Spriel's avatar Arend Van Spriel Committed by Kalle Valo
Browse files

ath6kl: assure headroom of skbuff is writable in .start_xmit()



An issue was found brcmfmac driver in which a skbuff in .start_xmit()
callback was actually cloned. So instead of checking for sufficient
headroom it should also be writable. Hence use skb_cow_head() to
check and expand the headroom appropriately.

Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Tested-by: default avatarSteve deRosier <derosier@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 4dcb7808
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -399,16 +399,11 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
			csum_dest = skb->csum_offset + csum_start;
		}

		if (skb_headroom(skb) < dev->needed_headroom) {
			struct sk_buff *tmp_skb = skb;

			skb = skb_realloc_headroom(skb, dev->needed_headroom);
			kfree_skb(tmp_skb);
			if (skb == NULL) {
		if (skb_cow_head(skb, dev->needed_headroom)) {
			dev->stats.tx_dropped++;
			kfree_skb(skb);
			return 0;
		}
		}

		if (ath6kl_wmi_dix_2_dot3(ar->wmi, skb)) {
			ath6kl_err("ath6kl_wmi_dix_2_dot3 failed\n");