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.

CRs-Fixed: 1089477
Change-Id: Id7efdd10ac76c989c086cb5f934a4b666b7c5939
Signed-off-by: Ashwanth Goli <ashwanth@codeaurora.org>
diff --git a/net/rmnet_data/rmnet_map_command.c b/net/rmnet_data/rmnet_map_command.c
index 306b6fb..6618f32 100644
--- a/net/rmnet_data/rmnet_map_command.c
+++ b/net/rmnet_data/rmnet_map_command.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -118,6 +118,7 @@
 {
 	struct rmnet_map_control_command_s *cmd;
 	int xmit_status;
+	int rc;
 
 	if (unlikely(!skb))
 		return;
@@ -146,6 +147,15 @@
 	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);
+		}
+	}
+
 }
 
 /* rmnet_map_command() - Entry point for handling MAP commands