[PATCH] tty: ipwireless: fix memory leak in do_go_offline()

From: Qingfang Deng

Date: Thu Mar 05 2026 - 22:45:49 EST


The ppp_channel is allocated and registered in do_go_online(). But when
the channel is unregistered in do_go_offline(), the driver forgets to
release its memory. This leads to a memory leak each time the network
goes online and then offline.

Fix this by adding a kfree call after unregistering the channel.

Fixes: 099dc4fb6265 ("ipwireless: driver for PC Card 3G/UMTS modem")
Signed-off-by: Qingfang Deng <dqfext@xxxxxxxxx>
---
drivers/tty/ipwireless/network.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/ipwireless/network.c b/drivers/tty/ipwireless/network.c
index ad2c5157a018..ec0353c1005a 100644
--- a/drivers/tty/ipwireless/network.c
+++ b/drivers/tty/ipwireless/network.c
@@ -303,6 +303,7 @@ static void do_go_offline(struct work_struct *work_go_offline)
spin_unlock_irqrestore(&network->lock, flags);
mutex_unlock(&network->close_lock);
ppp_unregister_channel(channel);
+ kfree(channel);
} else {
spin_unlock_irqrestore(&network->lock, flags);
mutex_unlock(&network->close_lock);
--
2.43.0