From patchwork Mon Sep 10 08:57:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 10593731 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 B34156CB for ; Mon, 10 Sep 2018 08:58:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FBBF28974 for ; Mon, 10 Sep 2018 08:58:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92CA428AE6; Mon, 10 Sep 2018 08:58:18 +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=BAD_ENC_HEADER,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 67D1428974 for ; Mon, 10 Sep 2018 08:58:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C34B76E256; Mon, 10 Sep 2018 08:58:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720074.outbound.protection.outlook.com [40.107.72.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4FC606E020; Mon, 10 Sep 2018 08:58:12 +0000 (UTC) Received: from MWHPR12CA0030.namprd12.prod.outlook.com (2603:10b6:301:2::16) by BY1PR12MB0423.namprd12.prod.outlook.com (2a01:111:e400:51b2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Mon, 10 Sep 2018 08:58:10 +0000 Received: from CO1NAM03FT004.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::201) by MWHPR12CA0030.outlook.office365.com (2603:10b6:301:2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.16 via Frontend Transport; Mon, 10 Sep 2018 08:58:10 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT004.mail.protection.outlook.com (10.152.80.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1143.11 via Frontend Transport; Mon, 10 Sep 2018 08:58:09 +0000 Received: from hr-intel.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Mon, 10 Sep 2018 03:58:08 -0500 From: Huang Rui To: , Subject: [PATCH 1/2] drm/ttm: set ttm_buffer_object pointer as null after it's freed Date: Mon, 10 Sep 2018 16:57:55 +0800 Message-ID: <1536569876-27262-1-git-send-email-ray.huang@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(39860400002)(396003)(376002)(136003)(2980300002)(428003)(189003)(199004)(97736004)(104016004)(450100002)(4326008)(106466001)(105586002)(53936002)(478600001)(72206003)(8676002)(47776003)(53416004)(305945005)(356003)(6666003)(2906002)(2870700001)(476003)(126002)(68736007)(7696005)(36756003)(50226002)(8936002)(81166006)(81156014)(486006)(5660300001)(50466002)(426003)(86362001)(110136005)(54906003)(336012)(2616005)(186003)(26005)(77096007)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR12MB0423; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT004; 1:b/zPfVsjuvOCz6v7V2k3yK/KsqZQanaSEZEBW5nEsOE2WwYuU+MrSo0s9MOoZH33hdqEWwwvgAlER/C93hAjvVJ5hAUR4rk2HTix4ITE+T8DLVgojdLZEKo7clz9MKO+ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a340c16b-3f03-478d-9f47-08d616fb8874 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:BY1PR12MB0423; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 3:U65nQd4OrWz/t/Kz0lg4ILTttRiz1AoyiUlQzptjbJ772szLkzyxprLKARS4/s63JQKh9wNwEHvBH0WlL5QpWlU5aV1WhnZusJ5qiTReFFq48Cs/1ZsExdLBW7WvI+VMEOFpohN7VcUhgIm+6RV6elz9UvpVipIK3YKbEDW7FM2KMNrQz5I0918WNZa8BYySLBD40miKxPsmKB/p4fqeshsKwLJ3SH2HINYbb+rbWWFFQFmacFrHC5zrqclyuvTphtcWnfRVnreCZqdW33NsaZbKb6bEY3LfES/rpMagN1est9ssRq5/aW3SwkVT1rhfc55isiaNoSWn3zVCaTBB1A3IuzxQWuT00LdKVhtgT3Q=; 25:HcbHuOLVLhDXDEAsV8AkQEdzj5StglihPQwV15BwBwBtQEIiU0HndCuxX8wq0k7VvwDRu5Wm24YpINiGPz1z5dUlggGAFl5sAVSy3TTVdy8ZnRx68nqGf6bNxSv89BlAiXd4DGz17qd78X92+wQgR/f0z/blEgMvN/1OQIhQdBDIIMu2qH1jFv/eKdAVr1fzFxUR52Rfx6fx2EDFOuQF3PG3hyz0aBXhZD+fLxz5lExxBcuBxg/bc8tTMm2FrklMEi9A6phNCCIp7rfeTruYOYhn8TpONihTsQMDd9BxPrIZMylKRzXovZrM4c4vAs4iEJw7/ZrfRNAlYPJAR8632A== X-MS-TrafficTypeDiagnostic: BY1PR12MB0423: X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 31:WO7IgiTB7Adygbdt16+hGQaAvtdL1JYgBEyAr93qGuGleDw4CN8sOZwgqJn6iprRuwK8XOf4NbYOQhRT5hKT/ecyK9hGraqwoo8QVNAmCBLFXa++MVK/vj+6s9yJMgquGmMxS9OYKegtyup8M+kvP8vvZ0Hrkh8/ikFgZx6vX7h/HamM0h6cg/WMOoARygXJskffCOxz/xIUHjwyzD5rPgxtY/UiLfzQw+FtTzd49HE=; 20:QoscSo5qp0wK65WEiH3ZA0ayGTGW9zooJUf+tFwm9YSMNDkG7wP9/59wDy4GH+LU5G/JcaiGO93M9uXkd/RHNa3CLLlsuTPD2ZOtIJNVg1ithLRtGrDZHr+MCmIIBmAQYYXDCjp4RfRTnnEaBNzk+aU1G58JF4VNSVw1Jk2Jqwnq/eAnjWEecQNgKEABlv7LTK1t1DBi9AX57kwyDtFIe3Sdv9JloOm5IfBCnpUs3jQGhoYzg16SfN3nRr8fOkEwxJV2XYeUP44KzAVXWPuOnE3U0tiIp03h21Qv5JUMtgu84LZ10Zxmt9WHUGchFqKSFNfVzekD+TBErE7LBOrI05lIYPxEYCqSsxO6bsmiQQcvTs9En92ywEWBIkZ6HkH4MQX5OaxRHSwWYJSAg2lLIVopto08f7lT9Ap8JZE1DJ8x7SNw0lN2s1S1e1P+RNfnS+gusQtJst8Jyq4GE+u+l4/bFkrLr8DialQiel4D5MwdMwDK9RRczMk+nvBpfu7z X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93003095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050); SRVR:BY1PR12MB0423; BCL:0; PCL:0; RULEID:; SRVR:BY1PR12MB0423; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 4:QyhlmsU+kukkbxwT0RJGKKKoT7W1+z5qz4ZtCpErV9mhdccPunmaju6ZlnNYzb7P5o+vlBEw7tR/cRCzsgPtgts5ceVFl/a9yCQoXXfN3FthO54ZxWRHLZnGS4wxyo9D+Quh7Kb7SswfoALJW2R74WJhZvfVTpKVNUNWtEwzLRrMxal4e5VJHogNjEEUsE8iUorlira+JXv+xF5iF0a8gZGzcdhCbMGZ5sv1nQf1zsmNj7EJSj5fDq2ubPvNQ3pNnv/ubJOoXqNR9o9DTcCchOXY/CcdOFOy1fPHgW46GJPQied5Oa0xdf0NCl0lvyEA X-Forefront-PRVS: 07915F544A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR12MB0423; 23:rJzplmYPRbeouBg9KvK/DmsKHLW0Xug1xWKuy9OO3?= FL27+XEUE0OujoWD2XLI2x/X066t6KTfICQCxrYRHWirTXJ2AvTBKkXbgne7IE2feB6T+1BIiys5Bxu/T5x809VA40sqDBJUsU88OOuSLhC/eDzal2NNGudXP92SVrveno+lz4FEOcPSF4+72EyUvBHD/J9+yjvdJ/5b7rpMmgvzzIDUj5ogRp/i36r4XnOZMADFvXzmxnt2UUVY2YtLCVxgS4mBSwN29zoP1vZ6DbVUNlv81xnW8mz7yjaOjnpAspH0n+jv+Bj0nA6mCgb2p4h620A88BlEIt65uE2ljKcg5wlDXuNQXa5WJmYAm7ZYnaklwnJjfQV9dB78d52pAquCl1UvaddH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tGgsLhoaf4DFiv9A7WVMNtwiw9vTyr9bgTgzorVqObOepUj4LSwryUAy91eLyEdD2hKdujVzr3DYrwCoqGwsoyEenqq2a9uPYc+AZL9s2tanmrXNJAsl6B3QRGhBdsz7OqKpFu/2kxIiXUs/hDVypmEDxg59puLSyMzJrvq2SOKu7KdNz/mNcu5dXf67E/X1y2cBSYeqXbbzOa4t0VTzRbMGd3Li/V X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 08:58:09.8012 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a340c16b-3f03-478d-9f47-08d616fb8874 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR12MB0423 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: Tom StDenis , Huang Rui , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP It avoids to be refered again after freed. Signed-off-by: Huang Rui Cc: Christian König Cc: Tom StDenis Signed-off-by: Huang Rui --- drivers/gpu/drm/ttm/ttm_bo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 138c989..d3ef5f8 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -54,6 +54,7 @@ static struct attribute ttm_bo_count = { static void ttm_bo_default_destroy(struct ttm_buffer_object *bo) { kfree(bo); + bo = NULL; } static inline int ttm_mem_type_from_place(const struct ttm_place *place,