Skip to contentSkip to conversation

net: usb: qmi_wwan: fix memory leak for not ip packets

PATCH Applied Daniele Palmas 3 participants 3 messages Aug 1, 2024 – Aug 5, 2024

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: usb: qmi_wwan: fix memory leak for not ip packets

Free the unused skb when not ip packets arrive.

Fixes c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support")
---
 drivers/net/usb/qmi_wwan.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/usb/qmi_wwan.c +1 -0
index 386d62769ded..cfda32047cff 100644
@@ -201,6 +201,7 @@ static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 			break;
 		default:
 			/* not ip - do not know what to do */
+			kfree_skb(skbn);
 			goto skip;
 		}
 
Signature · 1 line
2.37.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Daniele Palmas

Free the unused skb when not ip packets arrive.

Fixes c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support")
---
 drivers/net/usb/qmi_wwan.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/usb/qmi_wwan.c +0 -0
index 386d62769ded..cfda32047cff 100644

drivers/net/usb/qmi_wwan.c static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb) · line 206

Quoted 6 lines
drivers/net/usb/qmi_wwan.c +1 -0
@@ -201,6 +201,7 @@ static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 			break;
 		default:
 			/* not ip - do not know what to do */
+			kfree_skb(skbn);
 			goto skip;
 		}

Makes sense.