Skip to contentSkip to conversation

media: vpss: fix the order of resource clean up

PATCH In review Mukesh Ojha 2 participants 2 messages Mar 26, 2019 – Apr 1, 2019 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: vpss: fix the order of resource clean up

Clean up of resources should be in reverse order of vpss_init(). Fix this inside vpss_exit().

---
 drivers/media/platform/davinci/vpss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/davinci/vpss.c +1 -1
index 19cf685..e380fd3 100644
@@ -507,9 +507,9 @@ static int vpss_resume(struct device *dev)
 
 static void vpss_exit(void)
 {
+	platform_driver_unregister(&vpss_driver);
 	iounmap(oper_cfg.vpss_regs_base2);
 	release_mem_region(VPSS_CLK_CTRL, 4);
-	platform_driver_unregister(&vpss_driver);
 }
 
 static int __init vpss_init(void)
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Mukesh Ojha

Clean up of resources should be in reverse order of vpss_init(). Fix this inside vpss_exit().

---
 drivers/media/platform/davinci/vpss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Cheers,
--Prabhakar Lad

Quoted 19 lines
drivers/media/platform/davinci/vpss.c +1 -2
index 19cf685..e380fd3 100644
@@ -507,9 +507,9 @@ static int vpss_resume(struct device *dev)
 
 static void vpss_exit(void)
 {
+       platform_driver_unregister(&vpss_driver);
        iounmap(oper_cfg.vpss_regs_base2);
        release_mem_region(VPSS_CLK_CTRL, 4);
-       platform_driver_unregister(&vpss_driver);
 }
 
 static int __init vpss_init(void)
--

Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project