[openwrt/openwrt] unetmsg: add null check in TX disconnect callback

LEDE Commits lede-commits at lists.infradead.org
Mon Feb 16 00:20:53 PST 2026


nbd pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/e1728da72f5fc04c943b8240aab40988b212658b

commit e1728da72f5fc04c943b8240aab40988b212658b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Jan 4 10:04:58 2026 +0000

    unetmsg: add null check in TX disconnect callback
    
    The network may be deleted before the disconnect callback fires.
    Check for null to avoid crash when accessing net.tx_channels.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry picked from commit f631d1576ddb331ceee726d876ea9c74a3553dbc)
---
 .../unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc         | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc b/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc
index 59d9b0c278..63be3cbab0 100644
--- a/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc
+++ b/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc
@@ -350,6 +350,11 @@ function network_open_channel(net, name, peer)
 
 	let disconnect_cb = (req) => {
 		let net = networks[sock_data.network];
+		if (!net) {
+			network_tx_socket_close(sock_data);
+			return;
+		}
+
 		let cur_data = net.tx_channels[sock_data.name];
 		if (cur_data == sock_data)
 			delete net.tx_channels[sock_data.name];




More information about the lede-commits mailing list