aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2019-12-14 23:23:36 +0100
committerHarald Welte <laforge@osmocom.org>2019-12-14 23:26:02 +0100
commit56be0bf3176f36534e4ae74ec2c7c3f4c07a8465 (patch)
treebe2a516ab49ceb2359d80ea2d3dc73c2c252d203
parent60118315ccf3b864cbeb7b14a1eebe06ac5a0e99 (diff)
cardem: Fix memory leak on unsupported SIMTRACE_MSGT_DT_CEMU_CARDINSERT
Some boards like QMOD cannot simulate a virtual card insert signal towards the modem (as the mPCIe connector doesn't have that signal). In these situations, we were aborting processing of the related OUT endpoint command and forgot to release the related memory. Change-Id: I489097b7e332004e0f2beca0b22fa36d5d1d31b5 Related: OS#4251
-rw-r--r--firmware/libcommon/source/mode_cardemu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c
index 704e6ba..1669c2d 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -505,6 +505,7 @@ static void dispatch_usb_command_cardem(struct msgb *msg, struct cardem_inst *ci
if (!ci->pin_insert.pio) {
TRACE_INFO("%u: skipping unsupported card_insert to %s\r\n",
ci->num, cardins->card_insert ? "INSERTED" : "REMOVED");
+ usb_buf_free(msg);
break;
}
TRACE_INFO("%u: set card_insert to %s\r\n", ci->num,