From mboxrd@z Thu Jan 1 00:00:00 1970 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 CADB010976; Sat, 3 Feb 2024 04:10:19 +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=1706933419; cv=none; b=g+mSJBb2SPp9gcLXxlyPygPhsD7SL0invQXdf+zK9FVw32kYUk7cTmgZXaLO0FCyEbDsnb74c89qSa8xXMPyqgd6ufOdwdXn3Ucs7vqLGGRn4bxaA6FB9vp6t+cGlakUhh1NDpqrpG218ewA2hSydou/I7KZ4VvhxNznTQymNfU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706933419; c=relaxed/simple; bh=JSuhpo9wJBTV7jz4dRUsR6twuSp5hyKnp4eaDMaIYcU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=i4T1ysMEe/X/oMFC7UUpaWC9FZfz1FFsvcCVaIjl/Hhqhg9ZFO1U6mj5yRs3DVjbeEM1llW5F9jWhtXyP8qdreCTcVH23PTMW98qyyOJV0wG0gNCcmZXhiRsEAls8v1TXifx/16Dbhtyqdg+Fqvl4frQotZTd8bdRzHtgRUT7w4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BFFGmJvc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BFFGmJvc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91400C43394; Sat, 3 Feb 2024 04:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706933419; bh=JSuhpo9wJBTV7jz4dRUsR6twuSp5hyKnp4eaDMaIYcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BFFGmJvcJ3URWdpQVW7X50gzdcsuKtxk3PknmuOmQRAyH7rZv6Tv2AhHwuJpou9AC LSdd/EgHGyUolez79fGHYhCxKjcVvUW0RVoZt6wc053tdL8aZQuKuiujemKPMxjFJR yAeM/phn1ps3jl3uy0oAl4USNELd7ikZE983QZRc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mario Limonciello , Lijo Lazar , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Srinivasan Shanmugam , Sasha Levin Subject: [PATCH 6.1 143/219] drm/amdgpu: Fix *fw from request_firmware() not released in amdgpu_ucode_request() Date: Fri, 2 Feb 2024 20:05:16 -0800 Message-ID: <20240203035337.536774547@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240203035317.354186483@linuxfoundation.org> References: <20240203035317.354186483@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ 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