lkml.org 
[lkml]   [2024]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 6/7] staging: pi433: Add debugfs_remove in case of driver register fails.
Date
debugfs resources were never cleaned in case of failure to register driver.

Fixes: 4ef027d5a367 ("staging: pi433: add debugfs interface")
Reported-by Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Shahar Avidar <ikobh7@gmail.com>
---
drivers/staging/pi433/pi433_if.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index b01ee145ff3c..77e37a5bd1a2 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -1415,6 +1415,7 @@ static int __init pi433_init(void)
return 0;

unreg_class_and_remove_dbfs:
+ debugfs_remove(root_dir);
class_unregister(&pi433_class);
unreg_chrdev:
unregister_chrdev(MAJOR(pi433_devt), pi433_spi_driver.driver.name);
--
2.34.1

\
 
 \ /
  Last update: 2024-05-27 16:24    [W:0.095 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site