From patchwork Tue Apr 16 00:35:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karol Herbst X-Patchwork-Id: 10901769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A37051515 for ; Tue, 16 Apr 2019 00:35:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CE6328958 for ; Tue, 16 Apr 2019 00:35:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8112628961; Tue, 16 Apr 2019 00:35:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3DEFD28958 for ; Tue, 16 Apr 2019 00:35:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2754789791; Tue, 16 Apr 2019 00:35:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F4FA89650 for ; Tue, 16 Apr 2019 00:35:33 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id r4so24305739wrq.8 for ; Mon, 15 Apr 2019 17:35:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wJn0UhB3bPLMSz89xNiL5AQvj47M7O2b3KzzdMx/idM=; b=eenL0dGDBup6aZ68DS3iHymmxJ/5Qi6VaQJKIytHmOV7OH/pKuIusMAVXKrZay/n1A TprTIbtTdRNPDvoXTlxjwARpQpgY5q3A9vfBfFwnUZuc0KvqjoRMvjnArxif0WkTzzUH ZJsvuLLuyrQXyyrhsXYOugFztasqfFlkFjuhyePf5BUmB7/Cuh+/hGytIK2ii65TvmPf lpbUjbXmAd1L5mjpwxkDkTJHloyjcfINz92HKbou5tAy17bIzrb6HHVZ9MUR6Jhv/8bW LmpEoCSi/A6UNc4n66EMP4Sf77tz1Mv0dC/yRORHOcVVQVkAj/q25sXCSLq6tzGHmK0P hF3A== X-Gm-Message-State: APjAAAXTZvij2DLMcXKROKL3OLC2OeuExfbeSIgwWgwJf1jCzEB7v58C iQx2uFSx6cc6qybhASwHYF6xJwAQev4= X-Google-Smtp-Source: APXvYqwZk3Qkz+6mGp/p2Tuc8KaWF4gX0Z2oHMzjxlPc1S/gEdG4IeTGYwvj9ocWKVcI3xxQTDcShg== X-Received: by 2002:a5d:458f:: with SMTP id p15mr48796094wrq.188.1555374931783; Mon, 15 Apr 2019 17:35:31 -0700 (PDT) Received: from kherbst.pingu.com ([2a02:8308:b0be:6900:a1ae:358d:6041:7470]) by smtp.gmail.com with ESMTPSA id w2sm38801268wrm.74.2019.04.15.17.35.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2019 17:35:30 -0700 (PDT) From: Karol Herbst To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/6] Revert "drm/ttm: Fix bo_global and mem_global kfree error" Date: Tue, 16 Apr 2019 02:35:20 +0200 Message-Id: <20190416003523.5069-4-kherbst@redhat.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190416003523.5069-1-kherbst@redhat.com> References: <20190416003523.5069-1-kherbst@redhat.com> MIME-Version: 1.0 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: Alex Deucher , Karol Herbst Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 30f33126feca0fe16df9e9302ffc28a953e2eb37. Signed-off-by: Karol Herbst --- drivers/gpu/drm/ttm/ttm_bo.c | 1 + drivers/gpu/drm/ttm/ttm_memory.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 57c89161b5c6..6941562ef2fa 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1528,6 +1528,7 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj) container_of(kobj, struct ttm_bo_global, kobj); __free_page(glob->dummy_read_page); + kfree(glob); } void ttm_bo_global_release(void) diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index f1567c353b54..7704e17c402f 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -219,6 +219,14 @@ static ssize_t ttm_mem_global_store(struct kobject *kobj, return size; } +static void ttm_mem_global_kobj_release(struct kobject *kobj) +{ + struct ttm_mem_global *glob = + container_of(kobj, struct ttm_mem_global, kobj); + + kfree(glob); +} + static struct attribute *ttm_mem_global_attrs[] = { &ttm_mem_global_lower_mem_limit, NULL @@ -230,6 +238,7 @@ static const struct sysfs_ops ttm_mem_global_ops = { }; static struct kobj_type ttm_mem_glob_kobj_type = { + .release = &ttm_mem_global_kobj_release, .sysfs_ops = &ttm_mem_global_ops, .default_attrs = ttm_mem_global_attrs, };