Skip to content

Commit

Permalink
cifs: fix compiler warning in CIFSSMBQAllEAs
Browse files Browse the repository at this point in the history
The recent fix to the above function causes this compiler warning to pop
on some gcc versions:

  CC [M]  fs/cifs/cifssmb.o
fs/cifs/cifssmb.c: In function ‘CIFSSMBQAllEAs’:
fs/cifs/cifssmb.c:5708: warning: ‘ea_name_len’ may be used uninitialized in
this function

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
jtlayton authored and Steve French committed Jul 31, 2011
1 parent 91d065c commit 5980fc9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -5720,7 +5720,7 @@ CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon,
char *temp_ptr;
char *end_of_smb;
__u16 params, byte_count, data_offset;
unsigned int ea_name_len;
unsigned int ea_name_len = ea_name ? strlen(ea_name) : 0;

cFYI(1, "In Query All EAs path %s", searchName);
QAllEAsRetry:
Expand Down Expand Up @@ -5815,10 +5815,6 @@ CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon,
list_len -= 4;
temp_fea = ea_response_data->list;
temp_ptr = (char *)temp_fea;

if (ea_name)
ea_name_len = strlen(ea_name);

while (list_len > 0) {
unsigned int name_len;
__u16 value_len;
Expand Down

0 comments on commit 5980fc9

Please sign in to comment.