From patchwork Wed Apr 4 07:37:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xidong Wang X-Patchwork-Id: 10322489 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 82E09602C8 for ; Wed, 4 Apr 2018 12:05:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72EF228E55 for ; Wed, 4 Apr 2018 12:05:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66D2728E5A; Wed, 4 Apr 2018 12:05:03 +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=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 2C14828E55 for ; Wed, 4 Apr 2018 12:05:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16AF26E38C; Wed, 4 Apr 2018 12:05:01 +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 0DC586E06F; Wed, 4 Apr 2018 07:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=YzFhVHEASrKR+9GKyw ZpQxbyMYVvnVw6rIdpYsMNOA4=; b=G5r6N1GXWJbyNZ595Ig58z3p8qSm5IDxZO ycyBekXe0O7Hc7J1RRODwJ6XWm+HQ+EMfs2abiD+rQ3VB1bGW+jnTR5a+TQqM8NB r2I+aq/rnsEz12eNoP4PYWSHOw7zarP4ZQnRtIViFy52It7G0deNfYLGEqlwMq+k HXU8uFUx0= Received: from localhost.localdomain (unknown [106.120.213.14]) by smtp14 (Coremail) with SMTP id EsCowABXHqfUgMRaoAESDQ--.43829S3; Wed, 04 Apr 2018 15:38:00 +0800 (CST) From: Xidong Wang To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie Date: Wed, 4 Apr 2018 15:37:54 +0800 Message-Id: <1522827474-5120-1-git-send-email-wangxidong_97@163.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: EsCowABXHqfUgMRaoAESDQ--.43829S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrtFWUtw43AF1ktr1DWF4DArb_yoW3uFbE9a ykZr47W398Cw1qva45CrZxZFyIv3ZY9Fs29w18t3yftr1Ivan8Xr9xWry8Xr1fGa1UWFnx Ja1kZFs3tr13GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUYOiSJUUUUU== X-Originating-IP: [106.120.213.14] X-CM-SenderInfo: pzdqw5xlgr0wrbzxqiywtou0bp/1tbizRce81c7AcrkNgABsD 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(), the return value of kmem_cache_alloc() is freed with kfree(). I think the expected paired function is kmem_cahce_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..0414228 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(eb->i915->luts, lut); goto err_obj; }