From d2a529a0715311b17555aebf70c21ad87d67c71c Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 4 Oct 2021 15:37:57 +0200 Subject: [PATCH] gsm0710muxd-hack: Don't assert if channel was not opened When running with mtkfusionrild, it hits the assert. Instead of crashing, log a warning (as the code apparently used to do before Mediatek's changes). Related: https://github.com/freesmartphone/gsm0710muxd/blob/abcbcd7cc532a8834906de3fc24c8f8fe7643cd4/src/gsm0710muxd-hack/src/gsm0710muxd.c#L609-L615 --- src/gsm0710muxd-hack/src/gsm0710muxd.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/gsm0710muxd-hack/src/gsm0710muxd.c b/src/gsm0710muxd-hack/src/gsm0710muxd.c index 099b9e0..63c4d80 100644 --- a/src/gsm0710muxd-hack/src/gsm0710muxd.c +++ b/src/gsm0710muxd-hack/src/gsm0710muxd.c @@ -896,27 +896,10 @@ int pseudo_device_read(void *vargp) /* So, this time's newly read data should be stored to the local buf from the position buf + channel->remaining */ if (!channel->opened) { - /* Note by LS: In our implementation: each non-control channel must be opened at the initialization stage */ - Gsm0710Muxd_Assert(GSM0710MUXD_TXTHREAD_ERR); -#if 0 LOGMUX(LOG_WARNING, "Write to a channel which wasn't acked to be open."); - /* [Bug] Note by LS:But it already copied some data to the local buf !*/ - /* Possible solution#2: Copy the already read data to channel->tmp buffer */ - /* [Question] When to write the data stored in the channel->tmp buffer to the modem? and it may re-enter this function but UA is not received from the modem yet */ - /* - * if (len > 0) - * { - * char* previous_channel_tmp = channel->tmp; - * channel->tmp = malloc(len + channel->remaining); - * memcpy(channel->tmp, previous_channel_tmp, channel->remaining); - * memcpy(channel->tmp + channel->remaining, buf, len); - * channel->remaining = len; - * } - */ write_frame(channel->id, NULL, 0, GSM0710_TYPE_SABM | GSM0710_PF); LOGMUX(LOG_DEBUG, "Leave"); return 1; -#endif } /* Modify by LS */