From 56be0bf3176f36534e4ae74ec2c7c3f4c07a8465 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 14 Dec 2019 23:23:36 +0100 Subject: [PATCH] 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 --- firmware/libcommon/source/mode_cardemu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 704e6ba2..1669c2d2 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,