@@ -122,6 +122,11 @@ nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
122
122
if (nfs_server_capable (dir , NFS_CAP_SECURITY_LABEL ) == 0 )
123
123
return NULL ;
124
124
125
+ label -> lfs = 0 ;
126
+ label -> pi = 0 ;
127
+ label -> len = 0 ;
128
+ label -> label = NULL ;
129
+
125
130
err = security_dentry_init_security (dentry , sattr -> ia_mode ,
126
131
& dentry -> d_name , NULL ,
127
132
(void * * )& label -> label , & label -> len );
@@ -3796,7 +3801,7 @@ nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx,
3796
3801
int open_flags , struct iattr * attr , int * opened )
3797
3802
{
3798
3803
struct nfs4_state * state ;
3799
- struct nfs4_label l = { 0 , 0 , 0 , NULL }, * label = NULL ;
3804
+ struct nfs4_label l , * label ;
3800
3805
3801
3806
label = nfs4_label_init_security (dir , ctx -> dentry , attr , & l );
3802
3807
@@ -4682,7 +4687,7 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
4682
4687
int flags )
4683
4688
{
4684
4689
struct nfs_server * server = NFS_SERVER (dir );
4685
- struct nfs4_label l , * ilabel = NULL ;
4690
+ struct nfs4_label l , * ilabel ;
4686
4691
struct nfs_open_context * ctx ;
4687
4692
struct nfs4_state * state ;
4688
4693
int status = 0 ;
@@ -5033,7 +5038,7 @@ static int nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
5033
5038
struct nfs4_exception exception = {
5034
5039
.interruptible = true,
5035
5040
};
5036
- struct nfs4_label l , * label = NULL ;
5041
+ struct nfs4_label l , * label ;
5037
5042
int err ;
5038
5043
5039
5044
label = nfs4_label_init_security (dir , dentry , sattr , & l );
@@ -5074,7 +5079,7 @@ static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
5074
5079
struct nfs4_exception exception = {
5075
5080
.interruptible = true,
5076
5081
};
5077
- struct nfs4_label l , * label = NULL ;
5082
+ struct nfs4_label l , * label ;
5078
5083
int err ;
5079
5084
5080
5085
label = nfs4_label_init_security (dir , dentry , sattr , & l );
@@ -5193,7 +5198,7 @@ static int nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
5193
5198
struct nfs4_exception exception = {
5194
5199
.interruptible = true,
5195
5200
};
5196
- struct nfs4_label l , * label = NULL ;
5201
+ struct nfs4_label l , * label ;
5197
5202
int err ;
5198
5203
5199
5204
label = nfs4_label_init_security (dir , dentry , sattr , & l );
0 commit comments