Received: by 10.192.165.148 with SMTP id m20csp525245imm; Wed, 25 Apr 2018 03:39:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx487WMemV/P53qwTZcp5wQQ5qeihNWZ+cB3qd3D0j9ymgL/gmCa94tssltGWfk42GtMlJBjR X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr28867267plb.198.1524652799913; Wed, 25 Apr 2018 03:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524652799; cv=none; d=google.com; s=arc-20160816; b=g0DpGqxY3L3wnkCOGT2yzefyvg+2L/GLEkoIOnn1HY0lLbo3yqL29ficSjIwIq6TWF j8W+6KHsNS8LKoQ1lh6v8TEn0z9xHLjv28AtXn6eUcv9uRdJbp+pILAxsd5pNOIiD8hR tdhV4um02J/FHtwKDKDpkNVkimtmb6gInLqw9RTHm6QMoDcLB8yuvvLOz3DxJl5bAM+I vdqte4vXejCti/v1nYvjfMIDKBmPNMi0W+IG4XKIb1NY9w2Ko9odpPPQnLEmQqgpm4f2 J24ow6YdO7Dlfg3CrLhRJ5H6z/eujDTg0PPTsgNGzktmIT3vPPk4BRJSjiW8IOTdZs7n EXGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=nX+SWSyRQnW4DGU4BUWBUI46YiQSmqbqn4yeCQNb89I=; b=eFSjjlQzW0/HvhhFB3iSFLJmxK00+p+gLFV90IRNbk6Yq8tqwEWnlFNx5UtocUuaYa PZN5iKfk7a35HIHt+vfg2IReLQGwvtJpS6F08FysxEqzTWkmE9vFrRgKFYPMaPTxOMkh ZuQLvNKnMp9X94UuZrd+NxgAEkAYiSqgA93O/6mBxPZo4Hfs8Mm7VG/qCFWE3E14HOsC M49c8eOUQAs0enc91RQsbK4gYwmd2jBmKxPzmiJ2s/PuNt8rSy1Qkh5uOnfDcZVR8ZUi aKcRSyo4xP1xYajUwEsX/HNB553ZInnovTwI31RNc6tKUHl5r2qj7pu8BGGJuWYfnNkG h/Ig== ARC-Authentication-Results: i=1; mx.google.com; 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 t7si13521027pgs.654.2018.04.25.03.39.45; Wed, 25 Apr 2018 03:39:59 -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; 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 S1753002AbeDYKiP (ORCPT + 99 others); Wed, 25 Apr 2018 06:38:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51282 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753405AbeDYKiH (ORCPT ); Wed, 25 Apr 2018 06:38:07 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E005741C; Wed, 25 Apr 2018 10:38:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xidong Wang , Chris Wilson , Tvrtko Ursulin , Joonas Lahtinen Subject: [PATCH 4.14 009/183] drm/i915: Do no use kfree() to free a kmem_cache_alloc() return value Date: Wed, 25 Apr 2018 12:33:49 +0200 Message-Id: <20180425103242.977593179@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xidong Wang commit fcf1fadf4c65eea6c519c773d2d9901e8ad94f5f upstream. Along the eb_lookup_vmas() error path, the return value from kmem_cache_alloc() was freed using kfree(). Fix it to use the proper kmem_cache_free() instead. Fixes: d1b48c1e7184 ("drm/i915: Replace execbuf vma ht with an idr") Signed-off-by: Xidong Wang Cc: Chris Wilson Cc: Tvrtko Ursulin Cc: # v4.14+ Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180404093824.9313-1-chris@chris-wilson.co.uk (cherry picked from commit 6be1187dbffa0027ea379c53f7ca0c782515c610) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -722,7 +722,7 @@ static int eb_lookup_vmas(struct i915_ex err = radix_tree_insert(handles_vma, handle, vma); if (unlikely(err)) { - kfree(lut); + kmem_cache_free(eb->i915->luts, lut); goto err_obj; }