diff mbox series

[net,1/1] net: usb: qmi_wwan: fix memory leak for not ip packets

Message ID 20240801135512.296897-1-dnlplm@gmail.com (mailing list archive)
State Accepted
Commit 7ab107544b777c3bd7feb9fe447367d8edd5b202
Headers show
Series [net,1/1] net: usb: qmi_wwan: fix memory leak for not ip packets | expand

Commit Message

Daniele Palmas Aug. 1, 2024, 1:55 p.m. UTC
Free the unused skb when not ip packets arrive.

Fixes: c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support")
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
---
 drivers/net/usb/qmi_wwan.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bjørn Mork Aug. 1, 2024, 2:33 p.m. UTC | #1
Daniele Palmas <dnlplm@gmail.com> writes:

> Free the unused skb when not ip packets arrive.
>
> Fixes: c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support")
> Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
> ---
>  drivers/net/usb/qmi_wwan.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
> index 386d62769ded..cfda32047cff 100644
> --- a/drivers/net/usb/qmi_wwan.c
> +++ b/drivers/net/usb/qmi_wwan.c
> @@ -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.

Acked-by: Bjørn Mork <bjorn@mork.no>
Jakub Kicinski Aug. 5, 2024, 11:34 p.m. UTC | #2
On Thu,  1 Aug 2024 15:55:12 +0200 Daniele Palmas wrote:
> Free the unused skb when not ip packets arrive.
> 
> Fixes: c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support")
> Signed-off-by: Daniele Palmas <dnlplm@gmail.com>

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 386d62769ded..cfda32047cff 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -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;
 		}