From patchwork Thu Apr 4 20:33:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 13618199 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 823F1CD1292 for ; Thu, 4 Apr 2024 20:33:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 907591134E6; Thu, 4 Apr 2024 20:33:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="BnpHJp95"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B11C1134DE; Thu, 4 Apr 2024 20:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712262829; x=1743798829; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hUIkdF/D4sPjlMnpQtKFBjuuJZDXWBMNCAqHBzmhBGM=; b=BnpHJp95J7OYIyCAp/jiqKZ1KpWqIk43VQmuYf6X7Lk+LYg5xetkGVx4 NEPwtr/KXeNWJF4TItx0cnyvGoO66LyLHCMOAXXyqCh+SGKjBWAOxm8Un P9ao5Ka9PJ5yfEin6XHQPdG5mh57go09QGwjRxWaLGE3uDRUEyaKUJGoM 3spllKUuQt6pHO0jeAzzdRWVCXY4dOqs0TOJa8NwKtFSDVRF9wL9Yp2Hj 1ry2qXBbmAMstQfVGnxoL8ygmUbQHym9x+ge3N/KDD1askb+r8IdCqRG+ Cg3TSatUEvetvPmu4WNaCN7Rd2c6h9IfQnV0OI2H9Ls8PZdoV4GiJdgPH w==; X-CSE-ConnectionGUID: TbhgILQESCSyiGW678Ey4A== X-CSE-MsgGUID: Ecngad9fRa2xc0miMLoUWw== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="25019731" X-IronPort-AV: E=Sophos;i="6.07,180,1708416000"; d="scan'208";a="25019731" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 13:33:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="827790580" X-IronPort-AV: E=Sophos;i="6.07,180,1708416000"; d="scan'208";a="827790580" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by orsmga001.jf.intel.com with SMTP; 04 Apr 2024 13:33:46 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 04 Apr 2024 23:33:46 +0300 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org Subject: [PATCH 03/12] drm/client: Use drm_mode_destroy() Date: Thu, 4 Apr 2024 23:33:27 +0300 Message-ID: <20240404203336.10454-4-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240404203336.10454-1-ville.syrjala@linux.intel.com> References: <20240404203336.10454-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Ville Syrjälä Prefer drm_mode_destroy() over bare kfree(), for consistency and setting a good example. Signed-off-by: Ville Syrjälä Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_client_modeset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index 1c3aeb2dfa57..2b7d0be04911 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -329,7 +329,7 @@ static bool drm_client_target_cloned(struct drm_device *dev, if (!modes[i]) can_clone = false; } - kfree(dmt_mode); + drm_mode_destroy(dev, dmt_mode); if (can_clone) { DRM_DEBUG_KMS("can clone using 1024x768\n"); @@ -867,7 +867,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, break; } - kfree(modeset->mode); + drm_mode_destroy(dev, modeset->mode); modeset->mode = drm_mode_duplicate(dev, mode); drm_connector_get(connector); modeset->connectors[modeset->num_connectors++] = connector;