drivers: adsp: fix resource leak

Coverity defect: Variable msg_recv going out of scope leaks the
storage it points to. Fix the defect by freeing msg_recv before
return.

CID 31655

Bug 3461002

Change-Id: I350191943d342d33b1d07155ddcc2d875a78f7af
Signed-off-by: Prateek Patel <prpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653460
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Prateek Patel
2022-01-12 09:06:28 +00:00
committed by Laxman Dewangan
parent 5efd53d8fb
commit 35393d7615

View File

@@ -387,6 +387,7 @@ void adspff_fwrite(void)
(msgq_message_t *)&message);
if (ret < 0) {
pr_err("fwrite Dequeue failed %d.", ret);
kfree(msg_recv);
return;
}