Skip to contentSkip to conversation

FS: cifs: Fix compile warning

PATCH In review Javier Martinez Canillas 2 participants 2 messages Sep 11, 2010 – Sep 13, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 FS: cifs: Fix compile warning

In today linux-next I got a compile warning due a possibly uninitialized variable

This trivial patch solves the issue

Thanks a lot

---
 fs/cifs/cifssmb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/cifs/cifssmb.c +1 -1
index c65c341..ee1bba4 100644
@@ -3079,7 +3079,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
 		__u32 parm_len;
 		__u32 acl_len;
 		struct smb_com_ntransact_rsp *pSMBr;
-		char *pdata;
+		char *pdata = NULL;
 
 /* validate_nttransact */
 		rc = validate_ntransact(iov[0].iov_base, (char **)&parm,
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 16 lines · Javier Martinez Canillas

In today linux-next I got a compile warning due a possibly uninitialized variable

This trivial patch solves the issue

Thanks a lot

---
 fs/cifs/cifssmb.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
fs/cifs/cifssmb.c +0 -0
index c65c341..ee1bba4 100644

fs/cifs/cifssmb.c CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, · line 3082

Quoted 5 lines
fs/cifs/cifssmb.c +1 -1
@@ -3079,7 +3079,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
                __u32 parm_len;
                __u32 acl_len;
                struct smb_com_ntransact_rsp *pSMBr;
-               char *pdata;
+               char *pdata = NULL;

This looks like a compiler problem - the variable is always initialized by validate_ntransact except when
buf (which contains the smb) is null, when it returns -EINVAL and in that case pdata is not used.
Setting it to null would not help anyway - if it were left as null it would oops on the memcpy (where pdata is used).

This area of code has not changed recently.

Signature · 3 lines
Thanks,

Steve