Received: by 10.213.65.68 with SMTP id h4csp433049imn; Wed, 4 Apr 2018 00:41:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Xtbbh6+p8bgcloFNwgeju1PvqeGoF+bzWNuHxZQ0lcmrTUbWn9P4EQ1RVf2RNfNSHvezU X-Received: by 2002:a17:902:2ac3:: with SMTP id j61-v6mr17374779plb.224.1522827716486; Wed, 04 Apr 2018 00:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522827716; cv=none; d=google.com; s=arc-20160816; b=JGNr94TMlKApAUJ6+KenthPh6aaoNcaE2mLBnzbD4I3fOGD7NuEAAlek2R9MWsQrp1 7Adav/TGgjRpcPvVkS3oSq0eeM/uyfuYuemwpm3HigfbqXQbfzUHLK67Yl74pZT7g+So OW/h78NHH8y0MFxOEZRBeNuWBCHquGFqFZyVP88qLgnjo+NDu7ARJYjl/XZ7Dzzznb6B 39VwRVposfJb5eWXpSgyMQnOY5WehUNm3E7WAbnWobZoD7Wmq1LHFceDS8pZocX8ftuO 4sLKXzFfpgzH9iqYZ2NJszW52vTElzC795kSUA1vu3ZBW7QGtCo6Q6tgB30aKmvvxX6b 5c5g== 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=YzFhVHEASrKR+9GKywZpQxbyMYVvnVw6rIdpYsMNOA4=; b=K/tJsA2GOtQG+b8jr4dqKOnE8Hz9+tjKjhMZWzHh57wX9STqjI7sOmtcuWoctA+D0n P0pzsiMCAATFufnzqS9FWooucI/K41YLs3zEpvN3n4AuwAFGtAMOKpAe9iBkVFG0+3XI gMkaxXVKszZQNMWIbmDjz6UxkwOa5O2Lvf6qLvtYEXAsDGoAC23yUuvTj2SkbpCx8e18 0hUioBuHx+IgWEZRAh8JZEvsc+OpVzbrtkFfvzXJRmvxIqEip9liiqlfmUlSAgw3yUVU AEDwDe3XIbda2WQEFEJG0CDUjWfVqOjmTvcB/OQrtMEVCVcE2VEtYpvkJXRuQioidHXz yk/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=G5r6N1GX; 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 n9si3617523pfb.166.2018.04.04.00.41.42; Wed, 04 Apr 2018 00:41:56 -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=G5r6N1GX; 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 S1751264AbeDDHif (ORCPT + 99 others); Wed, 4 Apr 2018 03:38:35 -0400 Received: from m12-18.163.com ([220.181.12.18]:41363 "EHLO m12-18.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750711AbeDDHie (ORCPT ); Wed, 4 Apr 2018 03:38:34 -0400 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 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 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4