Received: by 10.223.185.116 with SMTP id b49csp1600171wrg; Wed, 14 Feb 2018 21:21:20 -0800 (PST) X-Google-Smtp-Source: AH8x226fC0JafW3NbHsOoDVS7XF7PbfMxPotC/J8IeadD5JCWKYOX7c27ZD41n6Y7qv03No2TYOh X-Received: by 10.99.5.197 with SMTP id 188mr1220513pgf.196.1518672080797; Wed, 14 Feb 2018 21:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518672080; cv=none; d=google.com; s=arc-20160816; b=s4Qydh+gLbLaoMguZaj9zVbiTD6W+7NgVBLzIxH7PqyRwdr8sMWK+BI86MHT9mBU98 phIJ/WvumVdxXC5jaUVo/dMiLbFyUxpK4ltOHJnx61SIDVanuLCmEA5LDhxIIg4cT6n5 MTlpprXx00tD8GqTfdIybpKZY0KJ0WCL3k5VJWjiGRLct7uVDuorMUSbrPovvOUHluWJ A3cCpHUIBHZd1x+sQDzRrmS3LucjeJRQ7zBDuOdN9DsiWHMHoPEgboatgdEJlMi3m+DZ yKJK5rpZR4pci8uNfxhVIaLCBYvvW7/2RNkyTZ9f2+bEowzftnT1GzLBXNFdyAJsLb44 jf5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=C1aq/y5ZNsl1mVA0ZJ1wvUta8QJ1abkgObWc/zf8co4=; b=CvimEMRiF0HXrZIMuspB115HfuV0QdXnUSBgdYYae1BEm65ORthuPkIrjXdVGnm/p/ WRl1ZgfmueRIl5SkM10ml7nD7IuTiyhyEyx6tclm+POmm9GGwBLyhyA+vRr2YY8YVxFA 4UQ7HxKBeB0St8lIc7PM8PNyOfRIv1saym+z8EMTYJoTEv4ixxWk+1tKJeuDMZFY7jRS 2lMM65cW2oeEBZeYtKFX6UVdF4llN8jOUR+lKKbp9u9LNeuXyF4T8d0l4BkQK/aS0j6N cNCM4ZOmZdf41+wctYVTMGxPd6CKYq+KIvr3HFg6JGk/J37vaBWsVipVm5gWv8Aesovi 3JnA== ARC-Authentication-Results: i=1; mx.google.com; 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 v11si3399383pgr.172.2018.02.14.21.21.04; Wed, 14 Feb 2018 21:21:20 -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; 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 S1751543AbeBOFUZ (ORCPT + 99 others); Thu, 15 Feb 2018 00:20:25 -0500 Received: from gateway20.websitewelcome.com ([192.185.62.46]:49989 "EHLO gateway20.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750743AbeBOFUX (ORCPT ); Thu, 15 Feb 2018 00:20:23 -0500 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id B7FCC400C50FE for ; Wed, 14 Feb 2018 23:20:03 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id mBxje28UyBUMKmBxje3yN2; Wed, 14 Feb 2018 23:20:03 -0600 Received: from [189.175.4.238] (port=45954 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1emBxh-002rU9-9N; Wed, 14 Feb 2018 23:20:01 -0600 Date: Wed, 14 Feb 2018 23:20:00 -0600 From: "Gustavo A. R. Silva" To: Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , "David (ChunMing) Zhou" , David Airlie Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] drm/amdgpu_gem: fix error handling path in amdgpu_gem_va_update_vm Message-ID: <20180215052000.GA25691@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.4.238 X-Source-L: No X-Exim-ID: 1emBxh-002rU9-9N X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.175.4.238]:45954 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 7 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, if amdgpu_vm_bo_update() fails, the returned error is being ignored. Fix this by properly checking _r_ after calling amdgpu_vm_bo_update. Also, remove redundant code just before label _error_. Addresses-Coverity-ID: 1464280 ("Unused value") Fixes: 0abc6878fc2d ("drm/amdgpu: update VM PDs after the PTs") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index e48b4ec..db85fc0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -523,12 +523,13 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev, goto error; if (operation == AMDGPU_VA_OP_MAP || - operation == AMDGPU_VA_OP_REPLACE) + operation == AMDGPU_VA_OP_REPLACE) { r = amdgpu_vm_bo_update(adev, bo_va, false); + if (r) + goto error; + } r = amdgpu_vm_update_directories(adev, vm); - if (r) - goto error; error: if (r && r != -ERESTARTSYS) -- 2.7.4