From: Jani Nikula <jani.nikula@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/5] drm/i915: Use kcalloc more
Date: Thu, 19 Sep 2013 14:00:30 +0300 [thread overview]
Message-ID: <87wqmd6ppt.fsf@intel.com> (raw)
In-Reply-To: <20130919105016.GF6566@nuc-i3427.alporthouse.com>
On Thu, 19 Sep 2013, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Sep 19, 2013 at 01:38:18PM +0300, Jani Nikula wrote:
>> On Thu, 19 Sep 2013, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>> > diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
>> > index c38d575..763283e 100644
>> > --- a/drivers/gpu/drm/i915/i915_gpu_error.c
>> > +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
>> > @@ -791,7 +791,7 @@ static void i915_gem_record_rings(struct drm_device *dev,
>> >
>> > error->ring[i].num_requests = count;
>> > error->ring[i].requests =
>> > - kmalloc(count*sizeof(struct drm_i915_error_request),
>> > + kcalloc(count, sizeof(error->ring[i].requests),
>>
>> Crash boom bang.
>
> Not quite. This is evaluated at compile time by parsing the type rather
> than by pointer dereference.
Sizeof changes from sizeof(struct drm_i915_error_request) to
sizeof(struct drm_i915_error_request *). It'll break something. Maybe
not as spectacularly as I was implying.
Jani.
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2013-09-19 10:58 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-19 10:18 [PATCH 1/5] drm/i915: use pointer = k[cmz...]alloc(sizeof(*pointer), ...) pattern Daniel Vetter
2013-09-19 10:18 ` [PATCH 2/5] drm/i915: Use kcalloc more Daniel Vetter
2013-09-19 10:38 ` Jani Nikula
2013-09-19 10:50 ` Chris Wilson
2013-09-19 11:00 ` Jani Nikula [this message]
2013-09-19 11:12 ` Chris Wilson
2013-09-19 10:46 ` Chris Wilson
2013-09-19 11:53 ` Daniel Vetter
2013-09-19 12:06 ` [PATCH] " Daniel Vetter
2013-09-19 12:30 ` Chris Wilson
2013-09-19 12:35 ` Daniel Vetter
2013-09-19 12:41 ` Chris Wilson
2013-09-19 12:51 ` Daniel Vetter
2013-09-19 12:58 ` Chris Wilson
2013-09-20 22:37 ` Daniel Vetter
2013-09-19 13:40 ` Jani Nikula
2013-09-19 10:18 ` [PATCH 3/5] drm/i915: Ditch INTELFB_CONN_LIMIT Daniel Vetter
2013-09-19 10:53 ` Jani Nikula
2013-09-19 12:05 ` [PATCH] " Daniel Vetter
2013-09-19 13:32 ` Jani Nikula
2013-09-19 10:18 ` [PATCH 4/5] drm/i915: check for allocation overflow in error state capture Daniel Vetter
2013-09-20 23:39 ` Ben Widawsky
2013-09-19 10:18 ` [PATCH 5/5] drm/i915: Use unsigned for overflow checks in execbuf Daniel Vetter
2013-09-19 10:44 ` Chris Wilson
2013-09-19 12:00 ` [PATCH] " Daniel Vetter
2013-09-19 12:53 ` Daniel Vetter
2013-09-19 13:05 ` Chris Wilson
2013-09-19 10:46 ` [PATCH 5/5] " Jani Nikula
2013-09-19 10:34 ` [PATCH 1/5] drm/i915: use pointer = k[cmz...]alloc(sizeof(*pointer), ...) pattern Jani Nikula
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=87wqmd6ppt.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/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