* [PATCH] iommu/exynos: fix error handling in exynos_iommu_init()
@ 2023-01-04 9:57 Yang Yingliang
2023-01-05 18:06 ` Sam Protsenko
2023-01-20 12:47 ` Joerg Roedel
0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2023-01-04 9:57 UTC (permalink / raw)
To: iommu, linux-samsung-soc
Cc: m.szyprowski, semen.protsenko, jroedel, yangyingliang
If platform_driver_register() fails, it don't need unregister and call
kmem_cache_free() to free the memory allocated before calling register.
Fixes: bbc4d205d93f ("iommu/exynos: Fix driver initialization sequence")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/iommu/exynos-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index b0cde2211987..c1d579c24740 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1446,7 +1446,7 @@ static int __init exynos_iommu_init(void)
return 0;
err_reg_driver:
- platform_driver_unregister(&exynos_sysmmu_driver);
+ kmem_cache_free(lv2table_kmem_cache, zero_lv2_table);
err_zero_lv2:
kmem_cache_destroy(lv2table_kmem_cache);
return ret;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] iommu/exynos: fix error handling in exynos_iommu_init()
2023-01-04 9:57 [PATCH] iommu/exynos: fix error handling in exynos_iommu_init() Yang Yingliang
@ 2023-01-05 18:06 ` Sam Protsenko
2023-01-20 12:47 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Sam Protsenko @ 2023-01-05 18:06 UTC (permalink / raw)
To: Yang Yingliang; +Cc: iommu, linux-samsung-soc, m.szyprowski, jroedel
On Wed, 4 Jan 2023 at 03:38, Yang Yingliang <yangyingliang@huawei.com> wrote:
>
> If platform_driver_register() fails, it don't need unregister and call
> kmem_cache_free() to free the memory allocated before calling register.
>
> Fixes: bbc4d205d93f ("iommu/exynos: Fix driver initialization sequence")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
> drivers/iommu/exynos-iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index b0cde2211987..c1d579c24740 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1446,7 +1446,7 @@ static int __init exynos_iommu_init(void)
>
> return 0;
> err_reg_driver:
> - platform_driver_unregister(&exynos_sysmmu_driver);
> + kmem_cache_free(lv2table_kmem_cache, zero_lv2_table);
> err_zero_lv2:
> kmem_cache_destroy(lv2table_kmem_cache);
> return ret;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iommu/exynos: fix error handling in exynos_iommu_init()
2023-01-04 9:57 [PATCH] iommu/exynos: fix error handling in exynos_iommu_init() Yang Yingliang
2023-01-05 18:06 ` Sam Protsenko
@ 2023-01-20 12:47 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2023-01-20 12:47 UTC (permalink / raw)
To: Yang Yingliang; +Cc: iommu, linux-samsung-soc, m.szyprowski, semen.protsenko
On Wed, Jan 04, 2023 at 05:57:02PM +0800, Yang Yingliang wrote:
> drivers/iommu/exynos-iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
--
Jörg Rödel
jroedel@suse.de
SUSE Software Solutions Germany GmbH
Frankenstraße 146
90461 Nürnberg
Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-20 12:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-04 9:57 [PATCH] iommu/exynos: fix error handling in exynos_iommu_init() Yang Yingliang
2023-01-05 18:06 ` Sam Protsenko
2023-01-20 12:47 ` Joerg Roedel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.