Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp394133rdb; Mon, 22 Jan 2024 07:29:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFi6aaLRDSjYYxrdNIcmEeCzZ+nvaHgJ8O9rcDWVHkfuTz5UnwfS7UaI8PjgATP9JYpCMna X-Received: by 2002:a05:6512:2253:b0:50e:7a04:2229 with SMTP id i19-20020a056512225300b0050e7a042229mr1880710lfu.25.1705937373458; Mon, 22 Jan 2024 07:29:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705937373; cv=pass; d=google.com; s=arc-20160816; b=BLI5uiqSM3srkGLZBiSj6QqTHS8xLffafyA1lUXAS9oAX9yXLAYu2bXg/pPKosMGm6 2DKfVlBdTElSqEIIcxn7FWQX45EGxNjjA8R50h7F650/EYqjHF8grwvOzWVhGByJRVf2 GQ/xsnzwo2aOqw4GsIy9msRg9nzXWm3gB67znB4O97/FbZS169fNcGLkc+lNe3DBa4xF sE6K8sXFDTLPuLZtraJEQ6vJOwQXvxChFoTfAseiX/jDLmg6lYLp1s0E2zEnH/NlwcqE hTYBD/NDeXcWX0/juggqwMvyrtE7nUGo81Nt0IgL1b4oa5fMtE+/2d1Jvny028tl7EGJ 60Fg== 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=Dm/McXLbEQaMTUGsYdrKZAqz8mZzsSiZYLVodKl66+E=; fh=2Z41LfSKm6CUMiToe2jYfWMKEjvPaoi7iXr61uBFJKw=; b=p2xx3YqXThDNNjZy5TCyXSRjH/SG5/HpKtIlbmeU2Et9AXH4fwDR8ldUT8WGl2+ogH 0GJ046BT9q6GYAiYmf4VvLnL5XG3YCP6gVGm237sfN1a2m41UoNPOCdB4zhS2ujKXDnt bcwY+h1YoUhhyH3Ef5sgFtDLN1qnVSWN1eayoaDmBlLb0XY30g/ejilvXBGjfQl9PXzp zQcZq+CTx4uDkRQBKeaY8tgN66AhK9AYHKbVMqtDtU06tMLIB3lJ7Rx5pv3j73CVh9Xr kWT8Qjb4ngES4GdAqj79SbX+tQJq4f3aQ5hEhpaCGAgduqZPCH9Odiai0pS5VNoH8MXo hIjw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bvHUUYVT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33302-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h22-20020a17090619d600b00a30798db5c9si488349ejd.146.2024.01.22.07.29.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:29:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bvHUUYVT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33302-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8412A1F25A7C for ; Mon, 22 Jan 2024 15:28:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86F6C5F842; Mon, 22 Jan 2024 15:01:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bvHUUYVT" 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 AFDA34644F; Mon, 22 Jan 2024 15:01:58 +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=1705935718; cv=none; b=oC9mLC/wNBPNj31RduzndfVyc5QjOxkH16/wdhIrkRiPawxsGgeEAOEqq9dOBIkThNC9k0HUxUPUo3E3+SoE/4taGG1OKtx/dPlAWHpDbwOa4VSFguP9/zx8Pt1Mur5Wck7lszt9hkitvQwjZxOTkI/i4yxSFmNN5VIZ7xCGBKE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935718; c=relaxed/simple; bh=hlwss65vsu1JL9eiVYuXMgPJu8Gko63+U/Dym0795eo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Qx2scYw7Z0qjqy3VSdIOuN/VjU1j8Adonf6kyXi63V6EKqu1C1o7aF5olBs7E0riY91N5SuA7yBH7GPEayaZOSSUjA8TmP7PIm/+U2xvYT90hogTvMHAe/QyIso4BlSZS9bUGHs8Oig60TsfNvsPvh7DrsGgG5uy/kNZb7RIzQs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bvHUUYVT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DAECC433B1; Mon, 22 Jan 2024 15:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935718; bh=hlwss65vsu1JL9eiVYuXMgPJu8Gko63+U/Dym0795eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bvHUUYVTIUhEXexF1vZCsNSkKobYNJwyzlgeaBX5C0aEItr99UKqIOJ3WkHLZ7gSj 3Apw6VYNRAlhvvW3pYGr0DL+IcO7Di5tyuIdgxw1SRR7q1rmk6HepD1vCVNbSzbKnS 4RbkDvv63wlHhb4E6mYF5FoyF/VOahh+ZnZgSVbVJuVmiSkQLi56Cp153e1XKdWlhg 2xeLwvPXPdpQn/mm5+rJmUZock9KIZ1ybCL3oRcS6yTKPalwYGq7+Nk8ySz5DAqZUC dtCLnTIDzXj964mggLqjSdQHYBDB9ClbPwlSiD6hfHxIwybveN1B7DvbgKCBnN+jr/ fhnL88PbNWgaA== 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, Stanley.Yang@amd.com, lee@kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.7 80/88] drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()' Date: Mon, 22 Jan 2024 09:51:53 -0500 Message-ID: <20240122145608.990137-80-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-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.7.1 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 b14127429f30..0efb2568cb65 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c @@ -1397,9 +1397,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