Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp422275rdb; Mon, 22 Jan 2024 08:14:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtHWblOoytFJl2gIcHSV1wrLc7u+gUVOcYWhiBWtRgsBd0luzJpw3BrhaKB4Veog3prgwO X-Received: by 2002:a05:6a00:188d:b0:6d9:ac48:1ed5 with SMTP id x13-20020a056a00188d00b006d9ac481ed5mr6322509pfh.47.1705940063785; Mon, 22 Jan 2024 08:14:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705940063; cv=pass; d=google.com; s=arc-20160816; b=TK0vNcINpkAYru0Z9HYRi6ZYm64DqxMWjrPZ+MhToW2MUIP7IpgmvA537iaSnKGH+J UHZxEl2PBs4Rb9holcKUtAPUYnLua/AKAFXHKMT0PzevrekCOKerwZpTUrxX3QIi8k+7 911viN1FXBSKRAO+W+Oiph3yCRDDi1J6bLnwPQlOPi5YYxNZy4lUfDjDU+WY4GBovwxO O8yEuGh9LP1Ga0ITU+VNYC/q8kEXi9HdJesvsYTZ6h52K5aQFDdSJO6lN/PUZ6h5+ASc lbINqREXtQe1dxFZ7abPaCpSc5zfwcrbYJD+rjiGmA3qmWFgswvTfWiIbNiqkJ2JL1LN 5tQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PKBctQtA1wIs44k4nVJpdI9Ux/D02DU0SagvCs/Ax3s=; fh=R9vdODuD46HZX92hyV2jUJMFD6eP/AsW1WYppbQRQTE=; b=D6OVzsY6kwhKnMHAxM90i/MPzEQGNEOP3NB4wUD+FesUW+rQkeQ/W/NapmmoFGgQKX HyH0M9UP/i1EDCNR1o+3x4+sd0LLnqnKW1mRsPDiC0lefBeEINRpc8+TW4Gsu3kSRlwu e2zsjiI5sT0+LCvJgGBqkgYLgPmzzBOEHYydi0TRVQ4u8iap9zanKt/BZb4ureAyZKtt 8Ubwqk4Rd4NdyM0bgs0ZSOS09wBFFoRfOSoXXxxesOvC2CaH0/6TpmbBVS62fWumo+yH 6JjQWlQuymbVUjn75U/fEvQMLhdH0c0KwMt45ojauGe26omRdbiX7qi5yf3OaUYlNOY+ wlrA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y+kQpyf8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33448-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id kr18-20020a056a004b5200b006dbcf9abc94si4331209pfb.66.2024.01.22.08.14.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 08:14:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y+kQpyf8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33448-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8741E2815B7 for ; Mon, 22 Jan 2024 16:11:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03BA812BF07; Mon, 22 Jan 2024 15:12:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y+kQpyf8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D5FC4F886; Mon, 22 Jan 2024 15:12:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705936340; cv=none; b=EMzIOhoaH8jTwf1GKPNcfRznwMBIaMTrmBnLzoQknBU5j37+6nadBysi6O1kOTWuMMwLympC8QshcLt73J6wnApAQa2v0V0ARFQhHoGEn92HRxMJZUCLG0Weg4S+P/yMdysJs8SP0QieveM8og3pwVKNonLw10LY76bNJ+oiH+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705936340; c=relaxed/simple; bh=sd7iwprj+8LybP1sstXYWOpMSALRS7T7tigyJk1aFXM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jho7htMziL0fqKVEcKblQp8LagWr3iTGEO/bTjs2Eol5qXtgIF8KfjghoZWp3z+cekvJ746JxMlfR8Xj7pmvI0JkifBUtrOXMIeZdoz/BdTFbs21E5bM6HaTsjM4MbeOSjYenpxYJRJuaDLlQtsdvhjsqSKnvy9MTmz90Z4kJPY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y+kQpyf8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A615C43390; Mon, 22 Jan 2024 15:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705936340; bh=sd7iwprj+8LybP1sstXYWOpMSALRS7T7tigyJk1aFXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y+kQpyf87QuFc6rxIITMUfUiRx5tBggF5b5H3+fSm2mepEqekKdW/KyFLOLDUwM2Z yrANlBhv8del0y4PaW5oug04+KjYwAo4KoNc36uMsilfON6BB5rrWgqGGqd3z3vm+2 DILan3J1DvEhOWU64XJeRxhJ1klq7DCuLDq8SGfRAMeOjAjUzvL/1l8qQzld1UnUm8 Xfrx44ep3rf3RwC1nzN4kg8EHLmFWHDIZKUdiBJNXV0z15bMfG2Yh3pXr91aD4Ffq8 9A8PmVJ/IXslHiIjL3qxomTkN8+SQW4+S+1Fvn0i6OiHsZaA9Yu7xJFd7N4Y0/QTHo cAxE5DYYY2J/A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivasan Shanmugam , Mario Limonciello , Lijo Lazar , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin , Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, Lang.Yu@amd.com, le.ma@amd.com, Ori.Messinger@amd.com, Stanley.Yang@amd.com, lee@kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.1 47/53] drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()' Date: Mon, 22 Jan 2024 10:08:48 -0500 Message-ID: <20240122150949.994249-47-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122150949.994249-1-sashal@kernel.org> References: <20240122150949.994249-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.74 Content-Transfer-Encoding: 8bit From: Srinivasan Shanmugam [ Upstream commit 13a1851f923d9a7a78a477497295c2dfd16ad4a4 ] Fixes the below: drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c:1404 amdgpu_ucode_request() warn: '*fw' from request_firmware() not released on lines: 1404. Cc: Mario Limonciello Cc: Lijo Lazar Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c index 6e7058a2d1c8..779707f19c88 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c @@ -1110,9 +1110,13 @@ int amdgpu_ucode_request(struct amdgpu_device *adev, const struct firmware **fw, if (err) return -ENODEV; + err = amdgpu_ucode_validate(*fw); - if (err) + if (err) { dev_dbg(adev->dev, "\"%s\" failed to validate\n", fw_name); + release_firmware(*fw); + *fw = NULL; + } return err; } -- 2.43.0