Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2192064iof; Tue, 7 Jun 2022 22:44:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu4y7uXHQoUr0+aN4HFbSdi2i3fmdyS+Jya97KzIkvC2gtl0ixqCQFIQuthce/vXLSiXeK X-Received: by 2002:a17:902:ac8f:b0:163:fbb7:b057 with SMTP id h15-20020a170902ac8f00b00163fbb7b057mr32920896plr.67.1654667059552; Tue, 07 Jun 2022 22:44:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667059; cv=none; d=google.com; s=arc-20160816; b=mX0OUsVQcl80ENjBC2/ouYQR/gdBAm61/mdvkpMUJeWncq+J+Ig+g+m/E+JxiAt8VL OfpTpjZ7PExcVb8tJYYLLFrBsvWx8Z+4MtvV60NbG6XPgqRHy765GoEoxY86Va5gM5pK ujSBr7FI2SoqiaoZbsE5Rbj78MrWXyERLgSIOBbFtLKXdi015a2wCPMWczl8/A3XDN16 spSITaQIC0H9f8d77mkS4Qh5cmy2RdorUz82wycCt/DgzEMdtr2t2gzHID77x7dm336I jjXkwvW8KCtfFNbCZiAicnwl6ISIS61HISSjQUvooMXtt4ugOQz6XWqHr6XySsScsb6Q e+6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1RgdsblNPP1ScGmr5aGfXZ8tkbwibtav/o47tM/J4ls=; b=yaWTveFXojdlsurLB/jkw0VspkgI6NVi0wX0DHr+4FM/vSxYZtsmTcxIE20+qbUIll nVDQFcKcNlyIVZ6eOmufqXJz2VYzXJoriKTpKzBEMMJiDYMtnLDtWlFJe86VAofcyV9h 96Ap+HYMHOvxMKehRO+9qTfg9VgfqsiOT8bt68cF0mOfDT4beOlAS+EMcb2HOBcM17HB /PixuvEVjsC/sW+aFIL39sYW92A5RPY6e0DVz+fabLp1XbPcQVq0N7EbhxHtf8RUcBFK hrhYAIPWZQIO4bGAvqPPdGAPrHytKwcC3wAXqXbOhPGCIr80o/HA0wNC+LI9gN4cUE4D FV5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="0+FXpu/l"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id on12-20020a17090b1d0c00b001c62fca7148si26737223pjb.170.2022.06.07.22.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:44:19 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="0+FXpu/l"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 657909CC8E; Tue, 7 Jun 2022 22:09:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352854AbiFGSfc (ORCPT + 99 others); Tue, 7 Jun 2022 14:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350645AbiFGSBV (ORCPT ); Tue, 7 Jun 2022 14:01:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAF4A14B2C5; Tue, 7 Jun 2022 10:43:25 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9C04BB822B0; Tue, 7 Jun 2022 17:43:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D8E9C385A5; Tue, 7 Jun 2022 17:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623802; bh=hNsuAn+9pufZEh6kmLrx7j6VD2duSU6sqeBA0OR8Qe0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0+FXpu/l1hho5sC+XGSsUdKJFxJez9RGLnPsyNOxomwv/4sW1aCk1GMdSghfGhI/b CnuBLn5JX3IoPPMTR4bur/KZenrsXA7cMYje8ZeZ9VTEk1DiD1ruTvBpurjtfkGV/p +5VFgTAONnZUgd5IP68o2sQHozfGZaTrre9zmZsY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alice Wong , Alex Deucher , Sasha Levin Subject: [PATCH 5.15 098/667] drm/amdgpu/ucode: Remove firmware load type check in amdgpu_ucode_free_bo Date: Tue, 7 Jun 2022 18:56:03 +0200 Message-Id: <20220607164937.760913486@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164934.766888869@linuxfoundation.org> References: <20220607164934.766888869@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alice Wong [ Upstream commit ab0cd4a9ae5b4679b714d8dbfedc0901fecdce9f ] When psp_hw_init failed, it will set the load_type to AMDGPU_FW_LOAD_DIRECT. During amdgpu_device_ip_fini, amdgpu_ucode_free_bo checks that load_type is AMDGPU_FW_LOAD_DIRECT and skips deallocating fw_buf causing memory leak. Remove load_type check in amdgpu_ucode_free_bo. Signed-off-by: Alice Wong Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c index abd8469380e5..0ed0736d515a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c @@ -723,8 +723,7 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev) void amdgpu_ucode_free_bo(struct amdgpu_device *adev) { - if (adev->firmware.load_type != AMDGPU_FW_LOAD_DIRECT) - amdgpu_bo_free_kernel(&adev->firmware.fw_buf, + amdgpu_bo_free_kernel(&adev->firmware.fw_buf, &adev->firmware.fw_buf_mc, &adev->firmware.fw_buf_ptr); } -- 2.35.1