tty: ipwireless: fix memory leak in do_go_offline()
PATCH 1/1 tty: ipwireless: fix memory leak in do_go_offline()
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.
--- drivers/tty/ipwireless/network.c | 1 + 1 file changed, 1 insertion(+)
drivers/tty/ipwireless/network.c +1 -0
@@ -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);
Signature · 1 line
2.43.0
Quoted 9 lines · Qingfang Deng
The
ppp_channelis allocated and registered indo_go_online(). But when the channel is unregistered indo_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 <[email protected]>
Thanks, but the driver is going to be deleted.
Greg Kroah-Hartman
maintainerQuoted 6 lines · David Sterba
Quoted 5 lines · Qingfang Deng
The
ppp_channelis allocated and registered indo_go_online(). But when the channel is unregistered indo_go_offline(), the driver forgets to release its memory. This leads to a memory leak each time the network goes online and then offline.
Quoted 7 lines
Quoted 4 lines
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 <[email protected]>Thanks, but the driver is going to be deleted.
Great, can you send a patch to do that?
thanks,
greg k-h
Hi, Greg and David,
Quoted 2 lines · David Sterba
Thanks, but the driver is going to be deleted.
Even if this is being removed from tty-next, the fix should be applied and backported to -stable.
Regards,
Qingfang
Greg Kroah-Hartman
maintainerQuoted 8 lines · Qingfang Deng
Hi, Greg and David,
Quoted 2 lines · David Sterba
Thanks, but the driver is going to be deleted.
Even if this is being removed from tty-next, the fix should be applied and backported to -stable.
We can just delete it from stable trees, as obviously no one is using it.
thanks,
greg k-h