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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B61F8C7EE32 for ; Wed, 31 May 2023 13:51:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237134AbjEaNv0 (ORCPT ); Wed, 31 May 2023 09:51:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237013AbjEaNtf (ORCPT ); Wed, 31 May 2023 09:49:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6AD413E; Wed, 31 May 2023 06:45:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A96DB61476; Wed, 31 May 2023 13:45:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8573C4339B; Wed, 31 May 2023 13:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685540700; bh=tJs0BBXyyksiBCh7KXNkCxTBnrB5Hznrx5+VzKAsJPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ah9atT6ug8gBVmXLAoD775SvgLWci2L78g8BAgw2XiU66BcvNEcTIcWob+xexkuGC c+NktpbO+ArDMMC8jXSw68z8J7z4DxxR53EZ21F0S1v8ag4z2UzeinrEM2usmE/rCj YNEteK+mRN4IrSXB8oh8LauZB6ESTuL7lo+923wjrUnR5l/nqu9jzEPN7NFQX9plrC 2pAq4DE4/a+vYZtENCmWpfEIx1OFl7z+rDEAypX69pV9C6Ku9PoV3VfpViDGPIJjiW B4Isfwzdf6Bmy1il3TcCXYI8PO1Oq7Lrze7TbVj9Rwq0byZdYqVTfb6qHRDdmxtjoC sWUcXHxYtEwww== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sukrut Bellary , Alex Deucher , Sasha Levin , christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, Hawking.Zhang@amd.com, Jack.Gui@amd.com, Arunpravin.PaneerSelvam@amd.com, mario.limonciello@amd.com, Victor.Zhao@amd.com, le.ma@amd.com, Likun.Gao@amd.com, Jiadong.Zhu@amd.com, jesse.zhang@amd.com, candice.li@amd.com, YiPeng.Chai@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.10 21/21] drm:amd:amdgpu: Fix missing buffer object unlock in failure path Date: Wed, 31 May 2023 09:44:14 -0400 Message-Id: <20230531134415.3384458-21-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230531134415.3384458-1-sashal@kernel.org> References: <20230531134415.3384458-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sukrut Bellary [ Upstream commit 60ecaaf54886b0642d5c4744f7fbf1ff0d6b3e42 ] smatch warning - 1) drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:3615 gfx_v9_0_kiq_resume() warn: inconsistent returns 'ring->mqd_obj->tbo.base.resv'. 2) drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:6901 gfx_v10_0_kiq_resume() warn: inconsistent returns 'ring->mqd_obj->tbo.base.resv'. Signed-off-by: Sukrut Bellary Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 +++- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 0e3ff5c3766ed..72410a2d4e6bf 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -6702,8 +6702,10 @@ static int gfx_v10_0_kiq_resume(struct amdgpu_device *adev) return r; r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr); - if (unlikely(r != 0)) + if (unlikely(r != 0)) { + amdgpu_bo_unreserve(ring->mqd_obj); return r; + } gfx_v10_0_kiq_init_queue(ring); amdgpu_bo_kunmap(ring->mqd_obj); diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 629671f66b319..acef2227d992b 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -3800,8 +3800,10 @@ static int gfx_v9_0_kiq_resume(struct amdgpu_device *adev) return r; r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr); - if (unlikely(r != 0)) + if (unlikely(r != 0)) { + amdgpu_bo_unreserve(ring->mqd_obj); return r; + } gfx_v9_0_kiq_init_queue(ring); amdgpu_bo_kunmap(ring->mqd_obj); -- 2.39.2