Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1029302ybe; Wed, 4 Sep 2019 11:23:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpUoJRO7HvRtBVdNw2GaTghWxYIEyoMdhEyX70pBCc1wkdFYl37MRIf2G0NS99Lb7eqrFu X-Received: by 2002:a17:902:9689:: with SMTP id n9mr42786826plp.3.1567621415094; Wed, 04 Sep 2019 11:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567621415; cv=none; d=google.com; s=arc-20160816; b=BWyHOLfSOFDpqzFpD0SJWHfhgUybJx+5CW7H4k2fHr63Qr3qWJ9O15iOgR6j5XFBsT U5LRMap8Va0E/uQbYwHBTLDVrCKrgynHl46hA46P+XhBS7q5tj6ILuIo+o7HRxkvGy6n xY3EVBCB7sktixO9Q7bp4UM5HxhDjF2biabQEIChM208aalnFtjlpYLwzNvkc7PeA5KU 7P1fO0sBZ2QbyFobmnrd/jfifT4V7FLIjj9Q9sMTU4TwsXycvF87kX7ExlGACS7U0COw hWOTgxhw0vWuc1aqQSoYOGzSQnULgvt1KNZcD9rf3JSNgqm116QZFJs7Nk9owfXxNWwZ hzbw== 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=P2jO2m3u8qAGigi8uvfF8AcpSmnxLeb0GLlLQTg0kI0=; b=Di+XY4OZlPXHfpc8m3kCbIr4aNfDvVDfbCX7CrdcIO7cwiem2bRQQOwkJHs6eYMFJh MDv74q03XaUN6WM7ufj1oS8HIx09oPAe4Gx09BDqPGYbJwRukMkiMGs6NT8kAA8VkQKi Wb+JN+nd/5PqRcx09NwdbjQYeez2OWVbQ2lhhJMGqoCWE6MSYZhdImAl0JkYPWmoZF5x gtAUubSPQ8Eqq1D0BwC23FKZ/jVahOzd28n9Ja1jdFActEtvvxWCZnYQ/2xJ0ipjS4ZM Wvd7VOyGzbwBYWRRGh3pIYFBWyVid3EnaoHD5tQofsEJ1GRzyGz+qAKSw9viCnhqmE7h KMqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=McxNEEzO; 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 j9si2868972pjz.23.2019.09.04.11.23.19; Wed, 04 Sep 2019 11:23:35 -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=McxNEEzO; 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 S2388554AbfIDSGC (ORCPT + 99 others); Wed, 4 Sep 2019 14:06:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:47784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389360AbfIDSF7 (ORCPT ); Wed, 4 Sep 2019 14:05:59 -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 0E418206B8; Wed, 4 Sep 2019 18:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620358; bh=0np0P7IWLxE9lnVSb3QHHfmMoU9gDJIs4h21PuBCexA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=McxNEEzO8ybG9uyXtby+yW66Cth47BWG3K/j7Z5ATynQFd1wadOLDcarvomKtR5WJ hPkYMaYDMF00ftodY+bNeGK1jlbVQeQWWh9YZylObHH5S4+P9D0+wjdYdb+mpOLhWF tnRp76ywibA5kOsGW10r+26EVmrt7EKlvQwjAKFw= 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 4.19 28/93] drm/bridge: tfp410: fix memleak in get_modes() Date: Wed, 4 Sep 2019 19:53:30 +0200 Message-Id: <20190904175305.756905244@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175302.845828956@linuxfoundation.org> References: <20190904175302.845828956@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 c3e32138c6bb0..9dc109df0808c 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -64,7 +64,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