mirror of
https://github.com/sysprog21/lkmpg.git
synced 2024-11-22 04:31:09 +08:00
procfs: Remove unnecessary cleanup on proc_create failure
This commit is contained in:
parent
433d031ae0
commit
5e2b7aa2e3
|
@ -77,7 +77,6 @@ static int __init procfs2_init(void)
|
||||||
{
|
{
|
||||||
our_proc_file = proc_create(PROCFS_NAME, 0644, NULL, &proc_file_fops);
|
our_proc_file = proc_create(PROCFS_NAME, 0644, NULL, &proc_file_fops);
|
||||||
if (NULL == our_proc_file) {
|
if (NULL == our_proc_file) {
|
||||||
proc_remove(our_proc_file);
|
|
||||||
pr_alert("Error:Could not initialize /proc/%s\n", PROCFS_NAME);
|
pr_alert("Error:Could not initialize /proc/%s\n", PROCFS_NAME);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,6 @@ static int __init procfs3_init(void)
|
||||||
our_proc_file = proc_create(PROCFS_ENTRY_FILENAME, 0644, NULL,
|
our_proc_file = proc_create(PROCFS_ENTRY_FILENAME, 0644, NULL,
|
||||||
&file_ops_4_our_proc_file);
|
&file_ops_4_our_proc_file);
|
||||||
if (our_proc_file == NULL) {
|
if (our_proc_file == NULL) {
|
||||||
remove_proc_entry(PROCFS_ENTRY_FILENAME, NULL);
|
|
||||||
pr_debug("Error: Could not initialize /proc/%s\n",
|
pr_debug("Error: Could not initialize /proc/%s\n",
|
||||||
PROCFS_ENTRY_FILENAME);
|
PROCFS_ENTRY_FILENAME);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
|
@ -98,7 +98,6 @@ static int __init procfs4_init(void)
|
||||||
|
|
||||||
entry = proc_create(PROC_NAME, 0, NULL, &my_file_ops);
|
entry = proc_create(PROC_NAME, 0, NULL, &my_file_ops);
|
||||||
if (entry == NULL) {
|
if (entry == NULL) {
|
||||||
remove_proc_entry(PROC_NAME, NULL);
|
|
||||||
pr_debug("Error: Could not initialize /proc/%s\n", PROC_NAME);
|
pr_debug("Error: Could not initialize /proc/%s\n", PROC_NAME);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,6 @@ static int __init sleep_init(void)
|
||||||
our_proc_file =
|
our_proc_file =
|
||||||
proc_create(PROC_ENTRY_FILENAME, 0644, NULL, &file_ops_4_our_proc_file);
|
proc_create(PROC_ENTRY_FILENAME, 0644, NULL, &file_ops_4_our_proc_file);
|
||||||
if (our_proc_file == NULL) {
|
if (our_proc_file == NULL) {
|
||||||
remove_proc_entry(PROC_ENTRY_FILENAME, NULL);
|
|
||||||
pr_debug("Error: Could not initialize /proc/%s\n", PROC_ENTRY_FILENAME);
|
pr_debug("Error: Could not initialize /proc/%s\n", PROC_ENTRY_FILENAME);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user