Received: by 10.192.165.148 with SMTP id m20csp580250imm; Wed, 25 Apr 2018 04:37:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Roakui6Sd8HXMV9ew/1oBLip4pAFrN5amT15Ia2aSVT0jCWUfKA+oewpW9cA7TKmR9Zgx X-Received: by 2002:a17:902:205:: with SMTP id 5-v6mr28154842plc.301.1524656245369; Wed, 25 Apr 2018 04:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524656245; cv=none; d=google.com; s=arc-20160816; b=Jwxw2BeSYKKfG3dTVQz3+85qWPsOQnY46lywzp75CgeBNigwghTu+PHjaTgx8GbAfa KuryCAekDCi1cm8wx5Hy1iz+zUlU+6gZiOnRrq5u4KE1q4dHV/AQSB5+A+n/gI9AW1I4 e6RiU1Xq9n0fSGN1SeYI7ey0EK5BYMq5SRyZaX5SQhk0m4spUlNsmVez6YZLCNOc28X1 odnRnb42tA/kBHpbzKi2AYq3BbEnmgZJmJJJCcEJT80XLJtbefvy/rPTxW7Rbw9zgvba tw9JckHd64YU2yggOi4j8f5rVzDzo0l8VEwSmEdIyntUrbr2uHJ79PTOj+5M03mWgON6 P6Dg== 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=wAw42egVp/HSR1SPVc7e3SxauP9bNJC4cK2OCdL+0rE=; b=YnpGY7GyyQVfOR4ObJGheADPryC8tdlurQG7W/L95Ke9/8kcozdj/akZm2sl0BWIBd RUXdZ3UQye0EPWEOQb0M8f8BSEYAgiS4bvHpn0JfBSZznx6GHkKZXTqfHV4n4XkRSyRW q4jNDNWXrm1MAG8Odt4MsQQ/9ko0GcfZG86wUFC1462lj/ZLKIgptLndyhz8k7YpKrMG X+GQDaUhx9o9SSqzlgw2xutShsArtevHbRBbveOHUTVSMbAcliDK65kWqH7FX6BWbhVE aY6w/Rj4pidwbXBMK/AyZmUrAioGLrM09sCx3kGyz1M2aOBwR6kk+HT5tUSqBZZqraTB gKbg== 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 b9si2188305pgq.210.2018.04.25.04.37.10; Wed, 25 Apr 2018 04:37:25 -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 S1753325AbeDYLfn (ORCPT + 99 others); Wed, 25 Apr 2018 07:35:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50770 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752315AbeDYKeF (ORCPT ); Wed, 25 Apr 2018 06:34:05 -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 89D9B42B; Wed, 25 Apr 2018 10:34:04 +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.16 14/26] drm/i915: Do no use kfree() to free a kmem_cache_alloc() return value Date: Wed, 25 Apr 2018 12:33:23 +0200 Message-Id: <20180425103315.415541155@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103314.842517924@linuxfoundation.org> References: <20180425103314.842517924@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.16-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 @@ -728,7 +728,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; }