From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D290022D786; Fri, 21 Mar 2025 16:49:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742575801; cv=none; b=R4kQxHNOnaERDVKLxcUF3uh6ZGCIx1NWxn6nC9DHFuFRl3yeVCIL9DFNuVAeThSAHbZulfLnJwmuRDOZzPBX1FEYMP3EZjolYDqO/q5ttLJemWTlmL44WocSx2kDbb4Xdbc0FCOnWS7NbmvoZPBgV3ovrdOQ7wss2esvtCNH9Hw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742575801; c=relaxed/simple; bh=7ZLBSwgjoEIfSznRwPheH9oHUGqDXbicJ1KRp4+oGXM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ES4dQXjSQLscG7JId+dPlIXd6BomDRnUKQoc1VwKEqOHD4I0S+KQPZKkD2kapFygzUV8ygxEfdu2DvY287St9QhmfEwzRfF3hyCqywqRTeAq918KG+QJRTOwe8AlVSvfa/lFsAX3ccwj+SOMWWQIH0Zhl/gqHqhwz3DYXnz5HE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=MGYKSNg8; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="MGYKSNg8" Received: from [10.0.0.114] (c-67-182-156-199.hsd1.wa.comcast.net [67.182.156.199]) by linux.microsoft.com (Postfix) with ESMTPSA id 49AC1202538A; Fri, 21 Mar 2025 09:49:59 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 49AC1202538A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1742575799; bh=dfc7HGYSq09N0vV5A9Bi6bT9CfzsYt4jHAqPhyqP6+8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MGYKSNg8NaasKcH0VjudKU/KMa00ld42lzKijtCy+EmKQTzsIkUQZGRVNiOYLbdEk QAHLDRMUH8khBW0cuinVXxWlQjSGMzGUvZS98xRS1JhxrrNnhzstIoy9K0Vn0LrRvJ E0Kp2ZBKb8ki/y4P1BEDkZrqsAiw11CcJYdNgtCA= Message-ID: Date: Fri, 21 Mar 2025 09:49:53 -0700 Precedence: bulk X-Mailing-List: linux-hyperv@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH next] Drivers: hv: mshv: Fix uninitialize variable in mshv_ioctl_passthru_hvcall() To: Dan Carpenter Cc: "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Praveen K Paladugu , Roman Kisel , Jinank Jain , Mukesh Rathor , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <97036225-597d-4a2d-8f51-7310757b9929@stanley.mountain> Content-Language: en-US From: Nuno Das Neves In-Reply-To: <97036225-597d-4a2d-8f51-7310757b9929@stanley.mountain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/21/2025 7:35 AM, Dan Carpenter wrote: > The "ret" variable could be uninitialized on the success path depending > on if "is_async" is true of false. Initialized it to zero. > > Fixes: f5288d14069b ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs") > Signed-off-by: Dan Carpenter > --- > drivers/hv/mshv_root_main.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c > index 29fa6d5a3994..b94d8fe0f691 100644 > --- a/drivers/hv/mshv_root_main.c > +++ b/drivers/hv/mshv_root_main.c > @@ -151,13 +151,14 @@ static int mshv_ioctl_passthru_hvcall(struct mshv_partition *partition, > void __user *user_args) > { > u64 status; > - int ret, i; > bool is_async; > struct mshv_root_hvcall args; > struct page *page; > unsigned int pages_order; > void *input_pg = NULL; > void *output_pg = NULL; > + int ret = 0; > + int i; > > if (copy_from_user(&args, user_args, sizeof(args))) > return -EFAULT; Thanks Dan, I already sent a fixup for this: https://lore.kernel.org/linux-hyperv/1742492693-21960-1-git-send-email-nunodasneves@linux.microsoft.com/