Skip to content

Commit

Permalink
Merge pull request #213 from keytouch/master
Browse files Browse the repository at this point in the history
procfs: Remove unnecessary cleanup on proc_create failure
  • Loading branch information
jserv authored Jul 23, 2023
2 parents 433d031 + 5e2b7aa commit 8172c03
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/procfs2.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ static int __init procfs2_init(void)
{
our_proc_file = proc_create(PROCFS_NAME, 0644, NULL, &proc_file_fops);
if (NULL == our_proc_file) {
proc_remove(our_proc_file);
pr_alert("Error:Could not initialize /proc/%s\n", PROCFS_NAME);
return -ENOMEM;
}
Expand Down
1 change: 0 additions & 1 deletion examples/procfs3.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ static int __init procfs3_init(void)
our_proc_file = proc_create(PROCFS_ENTRY_FILENAME, 0644, NULL,
&file_ops_4_our_proc_file);
if (our_proc_file == NULL) {
remove_proc_entry(PROCFS_ENTRY_FILENAME, NULL);
pr_debug("Error: Could not initialize /proc/%s\n",
PROCFS_ENTRY_FILENAME);
return -ENOMEM;
Expand Down
1 change: 0 additions & 1 deletion examples/procfs4.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ static int __init procfs4_init(void)

entry = proc_create(PROC_NAME, 0, NULL, &my_file_ops);
if (entry == NULL) {
remove_proc_entry(PROC_NAME, NULL);
pr_debug("Error: Could not initialize /proc/%s\n", PROC_NAME);
return -ENOMEM;
}
Expand Down
1 change: 0 additions & 1 deletion examples/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ static int __init sleep_init(void)
our_proc_file =
proc_create(PROC_ENTRY_FILENAME, 0644, NULL, &file_ops_4_our_proc_file);
if (our_proc_file == NULL) {
remove_proc_entry(PROC_ENTRY_FILENAME, NULL);
pr_debug("Error: Could not initialize /proc/%s\n", PROC_ENTRY_FILENAME);
return -ENOMEM;
}
Expand Down

0 comments on commit 8172c03

Please sign in to comment.