[PATCH 1/2] media: saa7134-go7007: Fix potential boot firmware leak

From: Tian Xuechen

Date: Fri Dec 04 2026 - 08:31:59 EST


A successful encoder boot leaves a firmware copy in go->boot_fw. Later
initialization failures free go directly, bypassing the normal release
callback that frees this buffer.

Free the cached firmware on the initialization error path.

This issue was found by our static analysis tool under development.

Fixes: 452015de2e2a ("[media] saa7134: add saa7134-go7007")
Signed-off-by: Tian Xuechen <202300460064@xxxxxxxxxxxxxxx>
---
drivers/media/pci/saa7134/saa7134-go7007.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/saa7134/saa7134-go7007.c b/drivers/media/pci/saa7134/saa7134-go7007.c
index 1f4d771793a2..92925bb21518 100644
--- a/drivers/media/pci/saa7134/saa7134-go7007.c
+++ b/drivers/media/pci/saa7134/saa7134-go7007.c
@@ -466,6 +466,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev)
if (saa->bottom)
free_page((unsigned long)saa->bottom);
kfree(saa);
+ kfree(go->boot_fw);
kfree(go);
return -ENOMEM;
}
--
2.34.1