Received: by 10.213.65.68 with SMTP id h4csp388527imn; Tue, 3 Apr 2018 23:39:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx48BJlWtv2/HW+MAqnTMOjRuipYYQ0Rkhp6OWEhJqpnHzVEpqUmeECXl5fdoCFb8C9r4zjkl X-Received: by 10.98.31.216 with SMTP id l85mr12981119pfj.80.1522823970578; Tue, 03 Apr 2018 23:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522823970; cv=none; d=google.com; s=arc-20160816; b=YjHaCz4aZrEl3LfWqDSjZOxIwKR17VTU7W08aaoCs0eST72FKyan1EOjGKMugv22B/ vWej1jtgbORdGBKw3AsKZihw8gi6BQNW1Ckkg8CRxc61K58PhZrCT4gl7MR6GUkCWjX1 fhcZpTCSh2Lj0hblReZ4Mh2/nOydIrfO+aOB3+bKk86loC98XYRMC+ndYdc9ZtZV0wRA UTIzCbJHYYML/n/PuNw1LIl2KFGL8fpzOCmAV+3M6mruFrnUVbeaccqlZwCHmEI0SUFS p3vzBnR0ZZogiUMT+oOhG53wZXEG8WaENnWSMps05J1GpjlXEHwH6LQb2dNf/ga66Rti eySg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=rd/VseM1ORa+15SbPqduwtjE4kD8c/V7E9GCfEVRidA=; b=izF6BLoxao7b9+WzB8UBd6zuuNLvH8hKcSsvqFtP4zkmNJ4c9vaiESQjgENTkfe32s //nw6ExPohvT9imgZ4SKMN/wt1Uuz4XYbuF0MkgmQt3xIH0HbaYZyc27UZEeQaxOF8gi hNPe0GddaJ6hErlXb4kPaAUWsu8NO7B4r+kRywF9xL3abpmsxxTg8rOG6cUqg7GRJI87 KuN/vhm/CgsVo8qCC3kDJpnFgpg3+eQ9Z+dKDB4AKEpuf6ce9RBC6SNSYqUJQhM2hvdx zB5hdCqcX8w27rrG/taAP10LKzSZECRWG+2zaBHacItk4dI6S7tj10JoLlJU9JdOwkMF YMKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=AD+KX5IV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12-v6si2805179pln.211.2018.04.03.23.39.16; Tue, 03 Apr 2018 23:39:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=AD+KX5IV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244AbeDDGiG (ORCPT + 99 others); Wed, 4 Apr 2018 02:38:06 -0400 Received: from m12-18.163.com ([220.181.12.18]:45315 "EHLO m12-18.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbeDDGiF (ORCPT ); Wed, 4 Apr 2018 02:38:05 -0400 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 Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Xidong Wang Subject: [PATCH 1/1] drm/i915:Do not use kfree() to free kmem_cache_alloc() return value 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4