Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13476315ybl; Sun, 29 Dec 2019 12:49:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyJATsGmy9jXttCWcxMup/9A2nCQT3CNdzv0+qs6CfxfIt6KKAC27J19PzqCBYOQEbuzQlX X-Received: by 2002:a9d:74c4:: with SMTP id a4mr71212420otl.119.1577652590761; Sun, 29 Dec 2019 12:49:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652590; cv=none; d=google.com; s=arc-20160816; b=R6M4FgWxkSWdwrJkVAe3wZtqZ/9BOrgYQFL2JrMFfdpaLde3XsbAwxbZcmO1U84hAq kaok+D3ESZBFvWeDktjAb29zwXKQKpC41Fou0rxis11BKOccsk8c3aK9mvR2cowc4Zkw /nVQJ740ywE8SzJ3wpDju68wKl/xjVHrj3m5/RHzMegpA6SGw93huCK9OSZLg5Yzx3AH qCOILqStjt7cvfJLROznRlWYJrdqYh0GSjzuyh3+jlyTktMu4otB0F/soJCmtp/bM6pt LTR5eRQrdPVSpfEVhbTlI1dSALEGNUIPq0oNN8sztbxG1Lp1+XmAjAEQCbYMISfrG2VA 8GSg== 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=U+CiLZVWon/PpOsdZqaZydqiHCJKKPiGLxJADQAs8TQ=; b=jvkVrHjGx724fY6BIkiTLJLrGzWl/NGNcbsXHg5HhvpdR2x58XU8Zp37FesbxQWe8M jaZajI4H+OqaV0snPzBZWYdJ1VOUX7rwUm332zuUTawO2ghXr0qBgknOtQZaVPtQ1HVQ jLsbHTeSPnV2HKupRQoFTOgi+It5+E4es0/E3JFqgikhCfBODQRr8PjknGcwuijYZr92 XfoQUHkh3P8oyj1r4CgFPHUun8mkM2gOGxEYr66aV6urFDitV3EyLl78U6PnPE/tdV4C OW6MeYHfex0Airwq5zs2sVdYO6n0Adeth4HFLx/cUkvC7HM0b+CGb4qwNLJwTAX9EMI0 038Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2QNwgzdU; 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 w23si18036640otp.109.2019.12.29.12.49.40; Sun, 29 Dec 2019 12:49:50 -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=2QNwgzdU; 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 S1733103AbfL2R4k (ORCPT + 99 others); Sun, 29 Dec 2019 12:56:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:46328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732829AbfL2R4f (ORCPT ); Sun, 29 Dec 2019 12:56:35 -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 C68F621D7E; Sun, 29 Dec 2019 17:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642194; bh=XNyOjk7dOfMLbguby3+sfOAlqecK394eaclydOGdahQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2QNwgzdUhXWiWzvJJ0bHNSMWZF6IghWoidoA+X49hf29Fzt56qY14sriQ7a67lhjZ axQDs+hNjR/yt1cu1KtIbPruDLbVV0TKEeMyPS8AqnxBmLNArHUw6b66yBzC8DRbQl H1ou7Mor88SCWoIF5SAVhyTRxNNzBiuYJpytS89g= 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 5.4 382/434] drm/amdgpu: fix uninitialized variable pasid_mapping_needed Date: Sun, 29 Dec 2019 18:27:15 +0100 Message-Id: <20191229172727.519205177@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@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 7700c32dd743..c7514f743409 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1035,7 +1035,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