Skip to content

Commit

Permalink
debugfs: fix missing mutex_destroy() in short_fops case
Browse files Browse the repository at this point in the history
we need that in ->real_fops == NULL, ->short_fops != NULL case

Fixes: 8dc6d81 "debugfs: add small file operations for most files"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/r/20241229081223.3193228-1-viro@zeniv.linux.org.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Al Viro authored and Greg Kroah-Hartman committed Jan 7, 2025
1 parent f8f2589 commit 24edfbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/debugfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static void debugfs_release_dentry(struct dentry *dentry)
return;

/* check it wasn't a dir (no fsdata) or automount (no real_fops) */
if (fsd && fsd->real_fops) {
if (fsd && (fsd->real_fops || fsd->short_fops)) {
WARN_ON(!list_empty(&fsd->cancellations));
mutex_destroy(&fsd->cancellations_mtx);
}
Expand Down

0 comments on commit 24edfbd

Please sign in to comment.