Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6017559ybc; Wed, 27 Nov 2019 13:29:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwQ835AivPft/Zzm3kMq677WJgHwKqk0MLp5/pym8cpgMDzNJPhEMbwgYrsnI1289KUiziF X-Received: by 2002:aa7:cd87:: with SMTP id x7mr34745173edv.153.1574890151531; Wed, 27 Nov 2019 13:29:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890151; cv=none; d=google.com; s=arc-20160816; b=mcnELjVweetJUenKzto6BMokjLT5ZfdtzgAb5UtznUo5EGmFdjVv1QNoZln1APrxGx ZbwwoAV1JxLr0pJ0TR/QrVtFB2fc4UY7z1RL+SuAvseNy+IuH41DNWOtALXwzEbnoIDB orU3oGoqrS0Q7Tyk9FfuSE9V4o/P8JBntcWMKwh/NCx8B0jLugc36VpjO5LgMRY9ucj7 mBIIURgU50KPRHHN6BwFdvqywzH4wZPES5z8xD/PC+jixle7t90gz5IBW4S9Lussat7F XD1oUt7Ux6RJ5YKy0QtAiTRaFu5Wq68wncSPAHDsev2vaVNXPijiSQQtkwXsEw0YY+0F rcmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cDSafAA6GynvxQiI05dYl1e2x0QMOuBcgyekeHMRPKQ=; b=qGag4Y+gUdQrwSRMjL/EwnOnuOp5s0qb8RYMBsMcIcfB6tmnuLIcWcC+t3d37fODsz jVnK/pVYG5QzpwnOYF5ViS+bDdb2KVa67f/0JccBDsvC2WwKEj1vcLWhg30joLRDYAFV ijemfIPW1VrM8Wp1+uqPvVjZ4CqEvBSfA9sMHZapny6jRiMw+SNwN1TUiGtF3FSY+bh5 Rws8H0Kt+ToFkgslu/f/Ml29evOhcEeP1HmbYMNRp1BFf2HG3nVxjMWmcEd5DsvutlAt eFyCbV8utcUTqVvmjmqEHjkfRMByNxvq7QXefC0GiNXWhl4XAVkdP7gf7m2JK4vshNY0 +NjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AEut9ZKA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si10415631ejb.49.2019.11.27.13.28.47; Wed, 27 Nov 2019 13:29:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AEut9ZKA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731586AbfK0VAh (ORCPT + 99 others); Wed, 27 Nov 2019 16:00:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:52532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729481AbfK0VAg (ORCPT ); Wed, 27 Nov 2019 16:00:36 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4C6452084B; Wed, 27 Nov 2019 21:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888435; bh=kvrgsIZ8Gymbi6c4WYY9shIxHq3UQvTGVVPm6yj3KAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AEut9ZKAadiq6bgmAPSaAzNhWAjcDuk5rVlFg2l5+XmF6yuadiUwVjtuN2silL/Q2 LKD6w9ilE+deqYfSwx+ucp3KS2kN/G6WXAZPAVdELbCexFZneMk2CAlaijEd/AP57o I1yOqci+4ozss+z44wpWB05A3tcBI2UJSqHn1kDY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Garry McNulty , Steve French , Aurelien Aptel , Sasha Levin Subject: [PATCH 4.19 132/306] fs/cifs: fix uninitialised variable warnings Date: Wed, 27 Nov 2019 21:29:42 +0100 Message-Id: <20191127203124.721719986@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Garry McNulty [ Upstream commit ef2298a06d012973bbc592b86fe5ff730d4d0c63 ] In some error conditions, resp_buftype can be passed uninitialised to free_rsp_buf(), potentially resulting in a spurious debug message. If resp_buftype randomly had the value 1 (CIFS_SMALL_BUFFER) then this would log a debug message. The rsp pointer is initialised to NULL so there is no other side-effect. Detected by CoverityScan, CID 1438585 ("Uninitialized scalar variable") Detected by CoverityScan, CID 1438667 ("Uninitialized scalar variable") Detected by CoverityScan, CID 1438764 ("Uninitialized scalar variable") Signed-off-by: Garry McNulty Signed-off-by: Steve French Reviewed-by: Aurelien Aptel Signed-off-by: Sasha Levin --- fs/cifs/smb2pdu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index b1f5d0d28335a..9194f17675c89 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2283,7 +2283,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, struct cifs_ses *ses = tcon->ses; struct kvec iov[SMB2_CREATE_IOV_SIZE]; struct kvec rsp_iov = {NULL, 0}; - int resp_buftype; + int resp_buftype = CIFS_NO_BUFFER; int rc = 0; int flags = 0; @@ -2570,7 +2570,7 @@ SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_ses *ses = tcon->ses; struct kvec iov[1]; struct kvec rsp_iov; - int resp_buftype; + int resp_buftype = CIFS_NO_BUFFER; int rc = 0; cifs_dbg(FYI, "Close\n"); @@ -2723,7 +2723,7 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, struct kvec iov[1]; struct kvec rsp_iov; int rc = 0; - int resp_buftype; + int resp_buftype = CIFS_NO_BUFFER; struct cifs_ses *ses = tcon->ses; int flags = 0; -- 2.20.1