From: Jani Nikula <jani.nikula@linux.intel.com>
To: Xidong Wang <wangxidong_97@163.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
David Airlie <airlied@linux.ie>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, Xidong Wang <wangxidong_97@163.com>
Subject: Re: [PATCH 1/1] drm/i915:Do not use kfree() to free kmem_cache_alloc() return value
Date: Wed, 04 Apr 2018 11:16:42 +0300 [thread overview]
Message-ID: <87y3i38jyt.fsf@intel.com> (raw)
In-Reply-To: <1522823851-28177-1-git-send-email-wangxidong_97@163.com>
On Wed, 04 Apr 2018, Xidong Wang <wangxidong_97@163.com> wrote:
> 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().
Agreed. But did you try to compile your patch before sending?
Fixes: d1b48c1e7184 ("drm/i915: Replace execbuf vma ht with an idr")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: <stable@vger.kernel.org> # v4.14+
BR,
Jani.
>
> Signed-off-by: Xidong Wang <wangxidong_97@163.com>
> ---
> 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;
> }
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2018-04-04 8:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-04 6:37 [PATCH 1/1] drm/i915:Do not use kfree() to free kmem_cache_alloc() return value Xidong Wang
2018-04-04 8:16 ` Jani Nikula [this message]
2018-04-04 13:02 ` kbuild test robot
2018-04-04 13:24 ` kbuild test robot
2018-04-04 13:44 ` kbuild test robot
-- strict thread matches above, loose matches on Subject: below --
2018-04-04 7:37 [PATCH 1/1] drm/i915: Do " Xidong Wang
2018-04-04 7:56 ` Chris Wilson
2018-04-04 20:54 ` Chris Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3i38jyt.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=wangxidong_97@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).