From: Yifei Gao <gyf161023@gmail.com>
To: Bin Du <bin.du@amd.com>,
Nirujogi Pratap <pratap.nirujogi@amd.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Sultan Alsawaf <sultan@kerneltoast.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Yifei Gao <gyf161023@gmail.com>
Subject: [PATCH v4 1/2] media: amd: isp4: release partial allocations in isp4if_alloc_fw_gpumem()
Date: Tue, 28 Jul 2026 19:07:39 +0000 [thread overview]
Message-ID: <20260728190754.363464-2-gyf161023@gmail.com> (raw)
In-Reply-To: <20260728190754.363464-1-gyf161023@gmail.com>
isp4if_alloc_fw_gpumem() allocates several GPU memory pools in sequence.
If one of them fails, it jumps to error_no_memory and returns -ENOMEM
without releasing the pools that were already allocated, leaking them.
Release the already-allocated pools before returning. isp4if_gpu_mem_free()
is a no-op on pools that were not allocated, so calling
isp4if_dealloc_fw_gpumem() here safely frees exactly the pools that
succeeded.
Fixes: 4c5feef6a62c ("media: platform: amd: Add isp4 fw and hw interface")
Signed-off-by: Yifei Gao <gyf161023@gmail.com>
---
drivers/media/platform/amd/isp4/isp4_interface.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/amd/isp4/isp4_interface.c b/drivers/media/platform/amd/isp4/isp4_interface.c
index 8d73f66bb42c..8e3616cce479 100644
--- a/drivers/media/platform/amd/isp4/isp4_interface.c
+++ b/drivers/media/platform/amd/isp4/isp4_interface.c
@@ -201,6 +201,7 @@ static int isp4if_alloc_fw_gpumem(struct isp4_interface *ispif)
error_no_memory:
dev_err(dev, "failed to allocate gpu memory\n");
+ isp4if_dealloc_fw_gpumem(ispif);
return -ENOMEM;
}
--
2.43.0
next prev parent reply other threads:[~2026-07-28 19:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 20:36 [PATCH] media: amd: isp4: fix self-deadlock in power-on error path Yifei Gao
2026-07-27 3:32 ` Bin Du
2026-07-27 18:34 ` [PATCH v2] media: amd: isp4: fix self-deadlock in isp4sd_pwron_and_init() " Yifei Gao
2026-07-28 10:17 ` Bin Du
2026-07-28 14:16 ` [PATCH v3 0/2] media: amd: isp4: fix error handling in isp4sd_pwron_and_init() Yifei Gao
2026-07-28 14:16 ` [PATCH v3 1/2] media: amd: isp4: release partial allocations in isp4if_alloc_fw_gpumem() Yifei Gao
2026-07-28 14:16 ` [PATCH v3 2/2] media: amd: isp4: fix self-deadlock in isp4sd_pwron_and_init() error path Yifei Gao
2026-07-28 17:35 ` Sakari Ailus
2026-07-28 19:07 ` [PATCH v4 0/2] media: amd: isp4: fix error handling in isp4sd_pwron_and_init() Yifei Gao
2026-07-28 19:07 ` Yifei Gao [this message]
2026-07-30 9:57 ` [PATCH v4 1/2] media: amd: isp4: release partial allocations in isp4if_alloc_fw_gpumem() Bin Du
2026-07-28 19:07 ` [PATCH v4 2/2] media: amd: isp4: fix self-deadlock in isp4sd_pwron_and_init() error path Yifei Gao
2026-07-30 14:14 ` [PATCH v5 0/2] media: amd: isp4: fix error handling in isp4sd_pwron_and_init() Yifei Gao
2026-07-30 14:14 ` [PATCH v5 1/2] media: amd: isp4: release partial allocations in isp4if_alloc_fw_gpumem() Yifei Gao
2026-08-03 7:22 ` Bin Du
2026-07-30 14:14 ` [PATCH v5 2/2] media: amd: isp4: fix self-deadlock in isp4sd_pwron_and_init() error path Yifei Gao
2026-08-03 7:22 ` Bin Du
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260728190754.363464-2-gyf161023@gmail.com \
--to=gyf161023@gmail.com \
--cc=bin.du@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=pratap.nirujogi@amd.com \
--cc=sakari.ailus@linux.intel.com \
--cc=sultan@kerneltoast.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®