From patchwork Wed Apr 4 06:37:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xidong Wang X-Patchwork-Id: 10322487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 36E8E602C8 for ; Wed, 4 Apr 2018 12:05:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A12628E55 for ; Wed, 4 Apr 2018 12:05:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C46928E5B; Wed, 4 Apr 2018 12:05:02 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable 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 8C9BE28E55 for ; Wed, 4 Apr 2018 12:05:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8BBF36E36C; Wed, 4 Apr 2018 12:05:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from m12-18.163.com (m12-18.163.com [220.181.12.18]) by gabe.freedesktop.org (Postfix) with ESMTP id AD1C96E026; Wed, 4 Apr 2018 06:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=rd/VseM1ORa+15SbPq duwtjE4kD8c/V7E9GCfEVRidA=; b=AD+KX5IVo7gxUFxZidEe4nYIexi5OTJH8f gmZ/d1cgtbA+4XY4uwZwJobT/+HlydPqpr6GRETvICjcx/kEvyp/spLDJ8vezvDW wb21vXHBpzbmLTL1koCGLOucUiTP7LocPaEfJ+wdD4dSr/RgQxAMfM0hhrkc1O9b yxZwPcv2M= Received: from localhost.localdomain (unknown [106.120.213.14]) by smtp14 (Coremail) with SMTP id EsCowAD389mtcsRaEjcKDQ--.42987S3; Wed, 04 Apr 2018 14:37:37 +0800 (CST) From: Xidong Wang To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie Date: Wed, 4 Apr 2018 14:37:31 +0800 Message-Id: <1522823851-28177-1-git-send-email-wangxidong_97@163.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: EsCowAD389mtcsRaEjcKDQ--.42987S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gr48KF4xur1rZr48GFy8Zrb_yoW3ZFbE9a 4kZr47W398Cw1qv3W3CrW3ZFy2y3ZYvFs29w1xt3yftr1Ivan8Xr9xXry8Zr1fGa1jqFn8 Xw4kZFs3tr13GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUY0fO7UUUUU== X-Originating-IP: [106.120.213.14] X-CM-SenderInfo: pzdqw5xlgr0wrbzxqiywtou0bp/1tbizRIe81c7AcqTnQAAsb X-Mailman-Approved-At: Wed, 04 Apr 2018 12:04:57 +0000 Subject: [Intel-gfx] [PATCH 1/1] drm/i915:Do not use kfree() to free kmem_cache_alloc() return value X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xidong Wang , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP In eb_lookup_vmas(), lut, the return value of kmem_cache_alloc(), is freed with kfree().I think the expected paired function is kmem_cache_free(). Signed-off-by: Xidong Wang --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 8c170db..08fe476 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -728,7 +728,7 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb) err = radix_tree_insert(handles_vma, handle, vma); if (unlikely(err)) { - kfree(lut); + kmem_cache_free(lut); goto err_obj; }