NFSD: Initialize pointer ni with NULL and not plain integer 0
authorColin Ian King <colin.king@canonical.com>
Sat, 25 Sep 2021 22:58:41 +0000 (23:58 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Sat, 2 Oct 2021 19:51:10 +0000 (15:51 -0400)
Pointer ni is being initialized with plain integer zero. Fix
this by initializing with NULL.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c

index 3f7e59e..3dc40c1 100644 (file)
@@ -1178,7 +1178,7 @@ extern void nfs_sb_deactive(struct super_block *sb);
 static __be32 nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
                struct nfsd4_ssc_umount_item **retwork, struct vfsmount **ss_mnt)
 {
-       struct nfsd4_ssc_umount_item *ni = 0;
+       struct nfsd4_ssc_umount_item *ni = NULL;
        struct nfsd4_ssc_umount_item *work = NULL;
        struct nfsd4_ssc_umount_item *tmp;
        DEFINE_WAIT(wait);
index 88c0a5c..e49a38c 100644 (file)
@@ -5531,7 +5531,7 @@ static void nfsd4_ssc_shutdown_umount(struct nfsd_net *nn)
 static void nfsd4_ssc_expire_umount(struct nfsd_net *nn)
 {
        bool do_wakeup = false;
-       struct nfsd4_ssc_umount_item *ni = 0;
+       struct nfsd4_ssc_umount_item *ni = NULL;
        struct nfsd4_ssc_umount_item *tmp;
 
        spin_lock(&nn->nfsd_ssc_lock);