mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] accel/rocket: put IOMMU domain on BO creation failure
@ 2026-07-08 11:43 Guangshuo Li
  2026-11-15 20:51 ` Heiko Stübner
  0 siblings, 1 reply; 2+ messages in thread
From: Guangshuo Li @ 2026-07-08 11:43 UTC (permalink / raw)
  To: Tomeu Vizoso, Oded Gabbay, Jeff Hugo, dri-devel, linux-kernel
  Cc: Guangshuo Li

rocket_ioctl_create_bo() takes an IOMMU domain reference for each newly
created BO.

The normal GEM object release path drops that reference from
rocket_gem_bo_free(). However, the BO creation error paths free the
object with drm_gem_shmem_object_free(), which bypasses the driver's GEM
.free callback. Those paths therefore release the shmem object without
dropping the IOMMU domain reference.

Drop the domain reference explicitly on the BO creation error path before
freeing the shmem object.

Fixes: 658ebeac3351 ("accel/rocket: Add IOCTL for BO creation")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
 drivers/accel/rocket/rocket_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/accel/rocket/rocket_gem.c b/drivers/accel/rocket/rocket_gem.c
index a5fffa51ff35..438694ba567b 100644
--- a/drivers/accel/rocket/rocket_gem.c
+++ b/drivers/accel/rocket/rocket_gem.c
@@ -127,6 +127,8 @@ int rocket_ioctl_create_bo(struct drm_device *dev, void *data, struct drm_file *
 	mutex_unlock(&rocket_priv->mm_lock);
 
 err:
+	rocket_iommu_domain_put(rkt_obj->domain);
+	rkt_obj->domain = NULL;
 	drm_gem_shmem_object_free(gem_obj);
 
 	return ret;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] accel/rocket: put IOMMU domain on BO creation failure
  2026-07-08 11:43 [PATCH] accel/rocket: put IOMMU domain on BO creation failure Guangshuo Li
@ 2026-11-15 20:51 ` Heiko Stübner
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stübner @ 2026-11-15 20:51 UTC (permalink / raw)
  To: Tomeu Vizoso, Oded Gabbay, Jeff Hugo, dri-devel, linux-kernel
  Cc: Guangshuo Li, Guangshuo Li

Am Mittwoch, 8. Juli 2026, 13:43:54 Mitteleuropäische Normalzeit schrieb Guangshuo Li:
> rocket_ioctl_create_bo() takes an IOMMU domain reference for each newly
> created BO.
> 
> The normal GEM object release path drops that reference from
> rocket_gem_bo_free(). However, the BO creation error paths free the
> object with drm_gem_shmem_object_free(), which bypasses the driver's GEM
> .free callback. Those paths therefore release the shmem object without
> dropping the IOMMU domain reference.
> 
> Drop the domain reference explicitly on the BO creation error path before
> freeing the shmem object.
> 
> Fixes: 658ebeac3351 ("accel/rocket: Add IOCTL for BO creation")
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-15 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-08 11:43 [PATCH] accel/rocket: put IOMMU domain on BO creation failure Guangshuo Li
2026-11-15 20:51 ` Heiko Stübner

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®