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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA47DC2BA18 for ; Thu, 20 Jun 2024 10:21:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 69E2D10E8A3; Thu, 20 Jun 2024 10:21:52 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="mPJOGzZj"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id 31A4610E8A3 for ; Thu, 20 Jun 2024 10:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718878911; x=1750414911; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=URS0Qt3USCIRZFnWBj/hR/PUU+4lYOxdLBJy7htzw4s=; b=mPJOGzZjWko0OgznUEWVS4kAFdHQL5jtJfJP7LdZI5x+k2G6tKlFh5Dp ylndDlVuELkSWx13KUWUamqZ/Q27XXCidyRTXeBFtu94icG8IIcc0ltcC /OTO9oK4KJFkLULmbJD0Tlp2rMWibaLJk7jKSD8o7J/34qPaSrknOUg34 IV+32R1HaRYnjvLWClpwBiHApMsQAYAAlltNg57SYAiC/IaTUJ/XsGA0N 0baW747ORnoKatNm+IHCo2MVPz1eSBWGatRX2GhrLTKLkC7KQFUwn6el8 Zw08QwaApSn8bZJfm2J9rsz5+QdA0IhveDjF3coR7c/j0ELtb7ZJEkWu8 g==; X-CSE-ConnectionGUID: 4ereprWcSjuBcMZWobYDkA== X-CSE-MsgGUID: 8gyXioasS+OCY07s1VSZSg== X-IronPort-AV: E=McAfee;i="6700,10204,11108"; a="41250399" X-IronPort-AV: E=Sophos;i="6.08,252,1712646000"; d="scan'208";a="41250399" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2024 03:21:32 -0700 X-CSE-ConnectionGUID: LfJu2XfbR4uAMh6IqCq5yw== X-CSE-MsgGUID: 9iu84QLzQOKFDjb+82GnYg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,251,1712646000"; d="scan'208";a="72926710" Received: from dalessan-mobl3.ger.corp.intel.com (HELO mwauld-desk.intel.com) ([10.245.245.229]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2024 03:21:30 -0700 From: Matthew Auld To: intel-xe@lists.freedesktop.org Cc: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Matthew Brost , stable@vger.kernel.org Subject: [PATCH] drm/xe: fix error handling in xe_migrate_update_pgtables Date: Thu, 20 Jun 2024 11:20:26 +0100 Message-ID: <20240620102025.127699-2-matthew.auld@intel.com> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Don't call drm_suballoc_free with sa_bo pointing to PTR_ERR. References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2120 Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Matthew Brost Cc: # v6.8+ --- drivers/gpu/drm/xe/xe_migrate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index 05f933787860..c9f5673353ee 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -1358,7 +1358,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m, GFP_KERNEL, true, 0); if (IS_ERR(sa_bo)) { err = PTR_ERR(sa_bo); - goto err; + goto err_bb; } ppgtt_ofs = NUM_KERNEL_PDE + @@ -1406,7 +1406,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m, update_idx); if (IS_ERR(job)) { err = PTR_ERR(job); - goto err_bb; + goto err_sa; } /* Wait on BO move */ @@ -1458,10 +1458,10 @@ xe_migrate_update_pgtables(struct xe_migrate *m, err_job: xe_sched_job_put(job); +err_sa: + drm_suballoc_free(sa_bo, NULL); err_bb: xe_bb_free(bb, NULL); -err: - drm_suballoc_free(sa_bo, NULL); return ERR_PTR(err); } -- 2.45.1