@@ -122,6 +122,11 @@ nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
122122 if (nfs_server_capable (dir , NFS_CAP_SECURITY_LABEL ) == 0 )
123123 return NULL ;
124124
125+ label -> lfs = 0 ;
126+ label -> pi = 0 ;
127+ label -> len = 0 ;
128+ label -> label = NULL ;
129+
125130 err = security_dentry_init_security (dentry , sattr -> ia_mode ,
126131 & dentry -> d_name , NULL ,
127132 (void * * )& label -> label , & label -> len );
@@ -3795,7 +3800,7 @@ nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx,
37953800 int open_flags , struct iattr * attr , int * opened )
37963801{
37973802 struct nfs4_state * state ;
3798- struct nfs4_label l = { 0 , 0 , 0 , NULL }, * label = NULL ;
3803+ struct nfs4_label l , * label ;
37993804
38003805 label = nfs4_label_init_security (dir , ctx -> dentry , attr , & l );
38013806
@@ -4683,7 +4688,7 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
46834688 int flags )
46844689{
46854690 struct nfs_server * server = NFS_SERVER (dir );
4686- struct nfs4_label l , * ilabel = NULL ;
4691+ struct nfs4_label l , * ilabel ;
46874692 struct nfs_open_context * ctx ;
46884693 struct nfs4_state * state ;
46894694 int status = 0 ;
@@ -5034,7 +5039,7 @@ static int nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
50345039 struct nfs4_exception exception = {
50355040 .interruptible = true,
50365041 };
5037- struct nfs4_label l , * label = NULL ;
5042+ struct nfs4_label l , * label ;
50385043 int err ;
50395044
50405045 label = nfs4_label_init_security (dir , dentry , sattr , & l );
@@ -5075,7 +5080,7 @@ static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
50755080 struct nfs4_exception exception = {
50765081 .interruptible = true,
50775082 };
5078- struct nfs4_label l , * label = NULL ;
5083+ struct nfs4_label l , * label ;
50795084 int err ;
50805085
50815086 label = nfs4_label_init_security (dir , dentry , sattr , & l );
@@ -5194,7 +5199,7 @@ static int nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
51945199 struct nfs4_exception exception = {
51955200 .interruptible = true,
51965201 };
5197- struct nfs4_label l , * label = NULL ;
5202+ struct nfs4_label l , * label ;
51985203 int err ;
51995204
52005205 label = nfs4_label_init_security (dir , dentry , sattr , & l );
0 commit comments