Skip to content

Commit af505ca

Browse files
Nirmoy Dasgregkh
authored andcommitted
debugfs: debugfs_create_file_size(): use IS_ERR to check for error
debugfs_create_file() returns encoded error so use IS_ERR for checking return value. Reviewed-by: Christian König <[email protected]> Signed-off-by: Nirmoy Das <[email protected]> Fixes: ff9fb72 ("debugfs: return error values, not NULL") Cc: stable <[email protected]> References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6880fa6 commit af505ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/debugfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ void debugfs_create_file_size(const char *name, umode_t mode,
528528
{
529529
struct dentry *de = debugfs_create_file(name, mode, parent, data, fops);
530530

531-
if (de)
531+
if (!IS_ERR(de))
532532
d_inode(de)->i_size = file_size;
533533
}
534534
EXPORT_SYMBOL_GPL(debugfs_create_file_size);

0 commit comments

Comments
 (0)