Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ab21974 authored by Gaurav Kohli's avatar Gaurav Kohli Committed by Gerrit - the friendly Code Review server
Browse files

firmware_class: Avoid memory leak when FW_OPT_NOCACHE is set



During call of request_firmware_into_buf, if FW_OPT_NOCACHE is
set then release_firmware skip freeing of fw_id. So explicitly
freeing the same to avoid memory leak.

Change-Id: I7e1d6f8f06c4532b2bcbf256267fd1e90f5ced70
Signed-off-by: default avatarGaurav Kohli <gkohli@codeaurora.org>
parent 85baaeb2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -295,6 +295,7 @@ static void fw_free_buf(struct firmware_buf *buf)
{
	struct firmware_cache *fwc = buf->fwc;
	if (!fwc) {
		kfree_const(buf->fw_id);
		kfree(buf);
		return;
	}