Received: by 10.223.185.116 with SMTP id b49csp2215003wrg; Thu, 15 Feb 2018 08:13:22 -0800 (PST) X-Google-Smtp-Source: AH8x224xA158AkfV0MerGjkqgbWCFcPwv0qGW5lbm6yl1WhD5w5RK4LyXvA47n6+3T62ZWokfR0l X-Received: by 10.98.19.220 with SMTP id 89mr3118936pft.59.1518711202412; Thu, 15 Feb 2018 08:13:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518711202; cv=none; d=google.com; s=arc-20160816; b=SE08Oll+mO/cbYqL+4EO57TuWQM3JypVgxTUDygYz2GQBm+QDcFzXM6XEscM4uP4rH Vp3oiia8hyGg+rVz/HPG4dPdrD2J1VvrauTpak7EMlHV9mAAiL63mHkwKRcuOBs8pSX4 JqgOzvXeD8w3Vp4cDtiCHu+xIikbBRyVV3j7Odr2OSe+JXM71QzYfxAd9apsTlH3NAkB emx9/f/3AP6CxB77wNVNQNKfg+Y/W2HVdTs5To2vHx8ALfL3+ZpILTsnK3XGgsr0wp1z OrTr0ohTwwDResxXyjmT1UiJNa3fwgnT7ppZ+gHWE3sVWArHu6rX1AhYC056CxIhL1V8 IWVw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=32a1NX1V8SJ/i8q1xKKo9E71YnYf2ZOpAxZy2vmraLQ=; b=uS/YnizyL+s9Br5KbRt8Iyc2EIb4EFrUySGpeLsaUlxKzBSdRkDwU7hm2v9BH0mDZ+ jnOu22dqQMpGcLR7V+dB5CE/vocEOc7CsNyymQDQcwufG59BSQw7KDp+nJGSUB2K0oaG Ef2gEybXMlqd5RINkhURyqODDEsVBiopHPnRSiTUOwZUkER/cbyKyr6pi4uMSawJiNOP GUF4JL5y2OFsU778hPudbWVmvaZGkHZcWYAt1JZL0yBFru/uJsS3ho7IcnSws+Z0bWVf bArYp3Ltoxs7DHQ/OYQW78RzC2/GmV/Wj4gljVz8MU9yGH0TPJ3f/FJavuPpKu6Kyn/u b+cA== 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 94-v6si1531195plf.451.2018.02.15.08.13.06; Thu, 15 Feb 2018 08:13:22 -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 S1425624AbeBOQLr (ORCPT + 99 others); Thu, 15 Feb 2018 11:11:47 -0500 Received: from gateway31.websitewelcome.com ([192.185.144.95]:36484 "EHLO gateway31.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424433AbeBOQLo (ORCPT ); Thu, 15 Feb 2018 11:11:44 -0500 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 787FD4C2BB for ; Thu, 15 Feb 2018 10:11:42 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id mM8MeDFaMBUMKmM8MeF0Sk; Thu, 15 Feb 2018 10:11:42 -0600 Received: from [189.175.4.238] (port=45682 helo=[192.168.1.66]) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1emM8L-003tqB-Vn; Thu, 15 Feb 2018 10:11:42 -0600 Subject: Re: [PATCH] drm/amdgpu_gem: fix error handling path in amdgpu_gem_va_update_vm To: christian.koenig@amd.com, "Gustavo A. R. Silva" , Alex Deucher , "David (ChunMing) Zhou" , David Airlie Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20180215052000.GA25691@embeddedgus> From: "Gustavo A. R. Silva" Message-ID: Date: Thu, 15 Feb 2018 10:11:40 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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: 1emM8L-003tqB-Vn X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.1.66]) [189.175.4.238]:45682 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 22 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 On 02/15/2018 06:32 AM, Christian König wrote: > Am 15.02.2018 um 06:20 schrieb Gustavo A. R. Silva: >> 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 > > Reviewed-by: Christian König > Thanks, Christian -- Gustavo >> --- >>   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) >