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

Commit 1841f380 authored by Ashwanth Goli's avatar Ashwanth Goli
Browse files

rmnet_data: queue QMAP control packets if start_xmit fails



rmnet_data does not free skb's when phy netdev
fails to xmit a qmap control packet cauing memory leak.
To avoid this we queue the packet back into device queue
if start_xmit fails.

Change-Id: Id7efdd10ac76c989c086cb5f934a4b666b7c5939
Signed-off-by: default avatarAshwanth Goli <ashwanth@codeaurora.org>
parent 315f8d16
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ static void rmnet_map_send_ack(struct sk_buff *skb,
{
	struct rmnet_map_control_command_s *cmd;
	int xmit_status;
	int rc;

	if (unlikely(!skb))
		BUG();
@@ -148,6 +149,15 @@ static void rmnet_map_send_ack(struct sk_buff *skb,
	netif_tx_unlock(skb->dev);

	LOGD("MAP command ACK=%hhu sent with rc: %d", type & 0x03, xmit_status);

	if (xmit_status != NETDEV_TX_OK) {
		rc = dev_queue_xmit(skb);
		if (rc != 0) {
			LOGD("Failed to queue packet for transmission on [%s]",
			     skb->dev->name);
		}
	}

}

/**