From patchwork Wed Sep 26 10:05:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 147556 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp514024lji; Wed, 26 Sep 2018 03:06:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV614UStP9nXfycHAiUZMdfcvCXMwKp723e35RoewBB2iOd0tW69uJY5uVwq45W4LGvauKyca X-Received: by 2002:a63:ff46:: with SMTP id s6-v6mr4474899pgk.241.1537956402853; Wed, 26 Sep 2018 03:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537956402; cv=none; d=google.com; s=arc-20160816; b=j+L3POUXJu6GB1NPZ+ZpBAuSM91MgrGkdrYzElPciAg21K6GbJWqJwS+M+oRMUVsiC KJk9YgLEU1F5n+ZDa/G9a3gHSG/jYbVL94XMHSA17Uch0flISm2BXALgNMcA7vSwSW91 GY2aJAMSs5xwdtM4RYpjtUzthpP9kPjuYhvETVsT9ZHJpWJwCDw/VsQ2E5qg+dhVmI4T zUCFfEjxYcSvRnM+8wtmvqlH2NVETI60Oth6zFCSK3LbC51nqMJutia+9dqU8kq6lof6 hsJPs7GveHSvxUYfbjB7fOAOYDuQL200yJ4JpGbh2pWBFUQlQ0kDyTudWN8OhqW0i7DZ zrzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=ruAhcpt31rJ/JkGVcvFAytDEn19eMOvDl5FfO5GYmDQ=; b=TNjZljZQW1WqZsH7EkmAj+tFbCsSnBupZpRzyApQ+NT4+hjZi0Q2OtyZENHwJW+FPd tETux3Ty9gG2vlEQ/9ZGXx6Gxlu/BGgcK7tuhpyC7boDSs49KMEwb5H2/Y8TvNrw8mRw 8NHBd3eRJTWowQf+uRCdFfJqCJMInXPVUxTQ4rVulgPSvrcxb0uvI0HA3ujSiw4BP6kD EZNYGqbx6Ke2aLvZDS+gGUCdeEtAsk0f8LB9OF1gByaecFKUnzEuXL0s5ri5ijCqQz+t 3qC6Y2CZvXHoeTiJbRQEhppDB8SajlD/ZbNLfDLbxvzazsjHbN61s2/6v1B5ZLw21hH1 z4PQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id s87-v6si4504333pfj.43.2018.09.26.03.06.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 03:06:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E69C26E40D; Wed, 26 Sep 2018 10:06:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 029CE6E40D for ; Wed, 26 Sep 2018 10:06:08 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id w8QA66wr098123; Wed, 26 Sep 2018 05:06:06 -0500 Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8QA66Ps001185; Wed, 26 Sep 2018 05:06:06 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 26 Sep 2018 05:06:06 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 26 Sep 2018 05:06:06 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8QA64Yq023167; Wed, 26 Sep 2018 05:06:05 -0500 From: Tomi Valkeinen To: Laurent Pinchart , Subject: [PATCH] drm/omap: fix use of freed memory Date: Wed, 26 Sep 2018 13:05:59 +0300 Message-ID: <20180926100559.30745-1-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" omap_connector_destroy() does: kfree(omap_connector); omapdss_device_put(omap_connector->output); omapdss_device_put(omap_connector->display); Fix this by moving the kfree after the omapdss_device_puts. This bug was introduced in 949ea2ef3fed4e1d0f9b80ec21ed81a9833ac248 Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/omap_connector.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index 98f5ca29444a..b81302c4bf9e 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c @@ -164,10 +164,11 @@ static void omap_connector_destroy(struct drm_connector *connector) drm_connector_unregister(connector); drm_connector_cleanup(connector); - kfree(omap_connector); omapdss_device_put(omap_connector->output); omapdss_device_put(omap_connector->display); + + kfree(omap_connector); } #define MAX_EDID 512