]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ocfs2: remove unnecessary NULL check before unregister_sysctl_table()
authorChen Ni <nichen@iscas.ac.cn>
Tue, 22 Apr 2025 07:30:51 +0000 (15:30 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:54:11 +0000 (17:54 -0700)
unregister_sysctl_table() checks for NULL pointers internally.  Remove
unneeded NULL check here.

Link: https://lkml.kernel.org/r/20250422073051.1334310-1-nichen@iscas.ac.cn
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/stackglue.c

index ddd761cf44c87837270d82d303e220733322ee27..a28c127b9934bc6ed2b2b40a0957fc82a3115706 100644 (file)
@@ -691,8 +691,7 @@ static void __exit ocfs2_stack_glue_exit(void)
        memset(&locking_max_version, 0,
               sizeof(struct ocfs2_protocol_version));
        ocfs2_sysfs_exit();
-       if (ocfs2_table_header)
-               unregister_sysctl_table(ocfs2_table_header);
+       unregister_sysctl_table(ocfs2_table_header);
 }
 
 MODULE_AUTHOR("Oracle");