Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1018113ybe; Wed, 4 Sep 2019 11:12:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqycMudikqL1OEFRPkIaiPG6mvKIhwLvjt7gO07wp26bW0MIETavJ27XlMBP8hT8VZW7o4nY X-Received: by 2002:a17:902:9a88:: with SMTP id w8mr6004419plp.161.1567620771203; Wed, 04 Sep 2019 11:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567620771; cv=none; d=google.com; s=arc-20160816; b=PmsVRxZxuur1H6/cryk5nx7daE5dl0bES0B3Ubhb5ng7JRoD50D9zv02szxUXFz3wB vchE6oZlKHcgfeEZDk2mIai0TY6qkiLMTfETqUwRTBHWgHkEhirLuc6zZvkAJVqxgQ98 kLrjJt8sQahFP9EbedAASx7yoS7NknkQ5IfC6On1ovm85hkQ+5jYG1NYbsnT7nBYBgx1 MvIHcCQtH+lOe6Z+OSJOgABlj52Er21zXq0O5+XMzivesEnsQE0kYgY7TGQ4iNflIeB3 LcEURDRmbyvghlVMMZ3TZD+4ndBm5mrFOoXYOq0nOUgmhVQK6mwhP8dhK20EtqmfiOqN OMjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7pFlwsA/rT6fuuCILGOpKKFhq/KJ+pn0M5OkpLdRYto=; b=0xhOpVqxwr8FzfwE1A5aOIkxznHb/PIX74W5wF+l6CZPGfOuAOg7LQypg4GzUm6oIU oSD7VqXZSoWXk6P7mtYBTDgLMjfU2Z3j8cae66VvmqVf1WYId5Y+oKeKabSEf11ZdbVv 3eXev4hN9Nvx3Nrv/s8MeNnB5SoJZ3EotwN+EG7JvVg8nVpch8vEsyQi30fUWVZYwBOj Y2YBqk7MNkcajMxcX/KEQMsu0clXfo2aGC9bRkyoN/a96ESxkXEIJPa8TGXDiZHlzpbG s4M6kd4Ekn42CRA9ThgEYerfqwo/yOpjszMcUBkDCk/GZwSBEmcS1kSsYBsd8x5HaVX9 YxtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PUo6hFHW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id co19si18300971plb.242.2019.09.04.11.12.35; Wed, 04 Sep 2019 11:12:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PUo6hFHW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390217AbfIDSLG (ORCPT + 99 others); Wed, 4 Sep 2019 14:11:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:54912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390218AbfIDSLC (ORCPT ); Wed, 4 Sep 2019 14:11:02 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0632222CEA; Wed, 4 Sep 2019 18:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620662; bh=PzqeueoE6W0jH8ZAn7V6GTCB6qOAVp98CDXFEjW9JAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PUo6hFHWNKXQd2RtseXwmYEFj2xniTBA1LxGssKa8q4tP5k3YfjFfibGFCAtr7ojY HkyF56amqfOv0ElGR7pZlX7hHALsODMifZqZw25paeKOzBbyj76VVcKlPlXPEvr5hd l8JmWXxr+g1dv7AS9+yHa9jJxERCh1VfTO9yVksM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomi Valkeinen , Andrzej Hajda , Sasha Levin Subject: [PATCH 5.2 047/143] drm/bridge: tfp410: fix memleak in get_modes() Date: Wed, 4 Sep 2019 19:53:10 +0200 Message-Id: <20190904175315.910263027@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit c08f99c39083ab55a9c93b3e93cef48711294dad ] We don't free the edid blob allocated by the call to drm_get_edid(), causing a memleak. Fix this by calling kfree(edid) at the end of the get_modes(). Signed-off-by: Tomi Valkeinen Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190610135739.6077-1-tomi.valkeinen@ti.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/ti-tfp410.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index 3a8af9978ebdf..791f164bdadc8 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -66,7 +66,12 @@ static int tfp410_get_modes(struct drm_connector *connector) drm_connector_update_edid_property(connector, edid); - return drm_add_edid_modes(connector, edid); + ret = drm_add_edid_modes(connector, edid); + + kfree(edid); + + return ret; + fallback: /* No EDID, fallback on the XGA standard modes */ ret = drm_add_modes_noedid(connector, 1920, 1200); -- 2.20.1