From patchwork Thu May 30 10:01:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13680095 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 53633C25B74 for ; Thu, 30 May 2024 10:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=HFltt1hnd5eEZqlBjH+rsbojBg3PN4U5GMZRmkqUXQ4=; b=IrMQDkR+/EfGqv mRekTMS1v1ps/bVGOkDGuFoIpKg8h0fZY4ZDmbRk/5JGcx6WG2gTpg8+zPuXmqU+QTJ1qzBsByfcQ VRMhd9k9u1xRAhMKjV4/qe6AqzNVL+/GqrIfX8TcguLfkvavGBzHHADWsKbGBEpDYnczUSUGyfU6F cL/dD/TqEw7yz/ZnpYaAIUAQqwAi1ni2LC8FgZAX4NsaVXi4ZYwc4aTUIPJ1KrINM8blIrB7ML3mo s36OFxOTxoBEGxb/wcNqhxPpQiw5h+ayMZRS9HGGJWq91ECs5R5JL2JnD/r3t3I8Nu98iIzQYsKa8 qE04OvLfQisDgwBmL3CQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCcbu-00000006ukp-0wjY; Thu, 30 May 2024 10:02:14 +0000 Received: from mgamail.intel.com ([198.175.65.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCcbs-00000006uji-0aYY for linux-arm-kernel@lists.infradead.org; Thu, 30 May 2024 10:02:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717063332; x=1748599332; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=1LP2rTo7NH0u3HUMgvoQtIkwfwWpjfpCFYaEhS+TgdI=; b=TDOBwbPU84iRW1WgGJQyLuWFe3deDO1LgwDpdDW3sdAx/oRLk22cnTXo SddAogpq2I2R+NQSNb1O/ARh0GjU7wV2ANN+wuUUQzwFC7sy40pEr+qjp jKVK3P33tXlaVE9M27pXe72aFrLxURpMpLQiRbNRfuI9V5+E6DqSX9G3j d+cY7zcTZk589yfUblgeMBJogJR9yxZebGdbCF0Sh1eAe+SVIbGLh+J8K sgq6C+JxzrHjzg5C2xLCSRcZT4HFj5JKuQLyT/GqEqRIKu3urlNnizc4z 78XJA5GG95nahbLiOsJLqCsYtUDNBT94OIxI3TSZEo9VF3kWytmctq4RD A==; X-CSE-ConnectionGUID: phGZTeMlQoqc7peUh4099A== X-CSE-MsgGUID: iC+5IWu0QViN0zXIkuCjOA== X-IronPort-AV: E=McAfee;i="6600,9927,11087"; a="24942803" X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="24942803" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 03:02:07 -0700 X-CSE-ConnectionGUID: 899tdr+XSt+622yob0QDcA== X-CSE-MsgGUID: q2Tk505KSB+DoG7+DejYbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="40235059" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO localhost) ([10.245.246.132]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 03:02:04 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: inki.dae@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, Jani Nikula , stable@vger.kernel.org Subject: [PATCH 1/4] drm/exynos/vidi: fix memory leak in .get_modes() Date: Thu, 30 May 2024 13:01:51 +0300 Message-Id: <20240530100154.317683-1-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240530_030212_246978_D3098CD5 X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The duplicated EDID is never freed. Fix it. Cc: stable@vger.kernel.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index fab135308b70..11a720fef32b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c @@ -309,6 +309,7 @@ static int vidi_get_modes(struct drm_connector *connector) struct vidi_context *ctx = ctx_from_connector(connector); struct edid *edid; int edid_len; + int count; /* * the edid data comes from user side and it would be set @@ -328,7 +329,11 @@ static int vidi_get_modes(struct drm_connector *connector) drm_connector_update_edid_property(connector, edid); - return drm_add_edid_modes(connector, edid); + count = drm_add_edid_modes(connector, edid); + + kfree(edid); + + return count; } static const struct drm_connector_helper_funcs vidi_connector_helper_funcs = {