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

Commit 6c7d6772 authored by Sujeet Kumar's avatar Sujeet Kumar
Browse files

USB: u_bam: Reserve skb headroom only if needed



Check if skb headroom is not available, then
reserve headroom.

Incase this is not done, it leads to skb_panic
because skb head would become lesser than skb
data.

CRs-Fixed: 644290
Change-Id: I9754abd01833d264ad0a73152c8a49be19364246
Signed-off-by: default avatarSujeet Kumar <ksujeet@codeaurora.org>
parent e3b81210
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -244,6 +244,8 @@ static struct sk_buff *gbam_alloc_skb_from_pool(struct gbam_port *port)
	} else {
		pr_debug("%s: pull skb from pool\n", __func__);
		skb = __skb_dequeue(&d->rx_skb_idle);
		if (skb_headroom(skb) < BAM_MUX_HDR)
			skb_reserve(skb, BAM_MUX_HDR);
	}

	spin_unlock_irqrestore(&port->port_lock_ul, flags);