lantiq: ltq-ptm: vr9: fix skb handling in ptm_hard_start_xmit()
authorMartin Schiller <ms@dev.tdt.de>
Tue, 21 Jan 2020 09:42:33 +0000 (10:42 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 26 Jan 2020 21:12:54 +0000 (22:12 +0100)
Call skb_orphan(skb) to call the owner's destructor function and make
the skb unowned.

This is necessary to prevent sk_wmem_alloc of a socket from overflowing,
which leads to ENOBUFS errors on application level.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
(cherry picked from commit 996f02e5bafad2815e72821c19d41fb5297e4dad)

package/kernel/lantiq/ltq-ptm/Makefile
package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c

index 13831a2b6f5dc5e27426ecc463e096516dd36ce5..abc6c3daabbe976ad626e833f8059ff447a5efe7 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-ptm
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-ptm-$(BUILD_VARIANT)
 
 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
index 9cfeefd80ef08f7987788def7a783e00e686e369..0162beef21bb532d673b9928406a4075a54e4ff5 100644 (file)
@@ -334,6 +334,9 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
         dma_cache_wback((unsigned long)skb->data, skb->len);
     }
 
+    /* make the skb unowned */
+    skb_orphan(skb);
+
     *(struct sk_buff **)((unsigned int)skb->data - byteoff - sizeof(struct sk_buff *)) = skb;
     /*  write back to physical memory   */
     dma_cache_wback((unsigned long)skb->data - byteoff - sizeof(struct sk_buff *), skb->len + byteoff + sizeof(struct sk_buff *));