From patchwork Thu Jul 28 16:48:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1016992 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6SGuNcq010792 for ; Thu, 28 Jul 2011 16:56:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755837Ab1G1Q4R (ORCPT ); Thu, 28 Jul 2011 12:56:17 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:56813 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755734Ab1G1Q4Q (ORCPT ); Thu, 28 Jul 2011 12:56:16 -0400 Received: by gyh3 with SMTP id 3so1953022gyh.19 for ; Thu, 28 Jul 2011 09:56:16 -0700 (PDT) Received: by 10.91.43.1 with SMTP id v1mr199434agj.114.1311871710695; Thu, 28 Jul 2011 09:48:30 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-076-182-054-018.nc.res.rr.com [76.182.54.18]) by mx.google.com with ESMTPS id p6sm222576anh.37.2011.07.28.09.48.29 (version=SSLv3 cipher=OTHER); Thu, 28 Jul 2011 09:48:30 -0700 (PDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH] cifs: fix compiler warning in CIFSSMBQAllEAs Date: Thu, 28 Jul 2011 12:48:26 -0400 Message-Id: <1311871706-8311-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.6 MIME-Version: 1.0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 28 Jul 2011 16:56:23 +0000 (UTC) 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 --- fs/cifs/cifssmb.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index acfbd41..f4d0988 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -5730,7 +5730,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: @@ -5825,10 +5825,6 @@ QAllEAsRetry: 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;