From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32157C2D0CE for ; Sun, 29 Dec 2019 17:37:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02D6420718 for ; Sun, 29 Dec 2019 17:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641062; bh=Y6wb9MOB1753wuANnE5dVfECKr08hB8NZ2DUOcT0f/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dP2QH02T0TJpvpV60F/OZ+/K5637YMnC2mKjnrStebEUAWPVMOtHq9Q1IJgCCewXH 99/08b2esCy0oecrApH+m+Tad5sbefBEQ+G3EtNhBJY0THaiAHFp7dkiMd2kMoAKwP q7CVT8K9tXjWFUAFZU0HGElY7G/aKu6KHgAq9YhY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729862AbfL2Rf1 (ORCPT ); Sun, 29 Dec 2019 12:35:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:39664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729844AbfL2RfW (ORCPT ); Sun, 29 Dec 2019 12:35:22 -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 B0757207FF; Sun, 29 Dec 2019 17:35:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640922; bh=Y6wb9MOB1753wuANnE5dVfECKr08hB8NZ2DUOcT0f/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xPLjUmyrncwM9lcckyw736ncLl5ilFBJPvRlMe5uPxoTLvZBS8MwkhL75XO/V+gf1 PFEx+lPeWC8ksZVTBl+uaxhyqcSZRnaGlQLNNzmiOh3oMvi36sqkILX7X6OOQls75t PEB0+rxF2ASyCMt8HaYNaJiaUCZH5nvvtcEzsEVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Colin Ian King , Alex Deucher , Sasha Levin Subject: [PATCH 4.19 194/219] drm/amdgpu: fix uninitialized variable pasid_mapping_needed Date: Sun, 29 Dec 2019 18:19:56 +0100 Message-Id: <20191229162539.154678416@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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: Colin Ian King [ Upstream commit 17cf678a33c6196a3df4531fe5aec91384c9eeb5 ] The boolean variable pasid_mapping_needed is not initialized and there are code paths that do not assign it any value before it is is read later. Fix this by initializing pasid_mapping_needed to false. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 6817bf283b2b ("drm/amdgpu: grab the id mgr lock while accessing passid_mapping") Reviewed-by: Christian König Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 69fb90d9c485..f67c332b16a4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -701,7 +701,7 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, bool need_ id->oa_size != job->oa_size); bool vm_flush_needed = job->vm_needs_flush; struct dma_fence *fence = NULL; - bool pasid_mapping_needed; + bool pasid_mapping_needed = false; unsigned patch_offset = 0; int r; -- 2.20.1