From patchwork Fri Mar 27 05:27:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 6103541 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 059D4BF90F for ; Fri, 27 Mar 2015 05:29:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32443203F3 for ; Fri, 27 Mar 2015 05:29:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43F4A203E5 for ; Fri, 27 Mar 2015 05:29:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752754AbbC0F2n (ORCPT ); Fri, 27 Mar 2015 01:28:43 -0400 Received: from mail-ob0-f182.google.com ([209.85.214.182]:32986 "EHLO mail-ob0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751200AbbC0F2l (ORCPT ); Fri, 27 Mar 2015 01:28:41 -0400 Received: by obcxo2 with SMTP id xo2so14994120obc.0; Thu, 26 Mar 2015 22:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lK+SxZV+Qn4KpaucCTuobshIjfGTyj56HM4wFD5fyCM=; b=pyhaiGrbd03ltax5lGrRN9laYhX333Y5ltKQOOe7ZrEAjCqykfSnZbUKVfJ7w6VINA at5AkRpELtcIKn/VAyUw2ipaJ7O9+078gXMvwOT9ynNIdbUj/i7Z8yVOYfTvtWCjRf/D jy+4Ka514o2Cd5piupOoipXkEOvFSriuPNmgB0AUCId5XSOX6p9DwoD3RIcLHRUX7yFq mSdQDTxtlQD5oqOJxdR6luunFNnk3P2YKJH6tw35BrNgNgRXj4XTj4r2TJuHLxtmtlPg 7UHxCJaTMhhdmMQz8nnyi5Hwrx91STWUymRB59sZ7Da2Nc9R9UyKEqHRP6wK+8OQUwxL 7+8A== X-Received: by 10.182.166.71 with SMTP id ze7mr13134689obb.73.1427434120830; Thu, 26 Mar 2015 22:28:40 -0700 (PDT) Received: from ubuntu.localdomain (cpe-68-203-16-26.austin.res.rr.com. [68.203.16.26]) by mx.google.com with ESMTPSA id mm3sm600258obb.1.2015.03.26.22.28.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 22:28:40 -0700 (PDT) From: Steve French To: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: smfrench@gmail.com Subject: [PATCH 1/4] [SMB3] Fix warning on uninitialized buftype Date: Fri, 27 Mar 2015 00:27:59 -0500 Message-Id: <1427434082-4299-2-git-send-email-smfrench@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427434082-4299-1-git-send-email-smfrench@gmail.com> References: <1427434082-4299-1-git-send-email-smfrench@gmail.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Pointed out by coverity analyzer. resp_buftype is not initialized in one path which can rarely log a spurious warning (buf is null so there will not be a problem with freeing data, but if buf_type were randomly set to wrong value could log a warning) Reported by Coverity (CID 1269144) Signed-off-by: Steve French Acked-by: Shirish Pargaonkar ACKed-by: Sachin Prabhu Reviewed-by: Jeff Layton --- fs/cifs/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 3417340..1b906de 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2114,7 +2114,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, struct kvec iov[2]; int rc = 0; int len; - int resp_buftype; + int resp_buftype = CIFS_NO_BUFFER; unsigned char *bufptr; struct TCP_Server_Info *server; struct cifs_ses *ses = tcon->ses;