wifi: mm81x: free the firmware scratch buffer on parse failures

mm81x_fw_load_fw() allocates fw_buf before it inspects the image, but
releases it only on the success path.  The two early returns taken for a
malformed image leave one firmware-sized allocation attached to the
device, and mm81x_fw_flash() retries the load three times.

Release it on those paths too, the way mm81x_fw_load_bcf() already does.

Fixes: b1906cea00 ("wifi: mm81x: add mm81x Wi-Fi HaLow driver")
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Link: https://patch.msgid.link/20260812060740.1275280-2-lilinmao@kylinos.cn
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
This commit is contained in:
Linmao Li 2026-08-12 14:07:37 +08:00 • committed by Lachlan Hodges
commit 87230a514d