lkml.org 
[lkml]   [2011]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] drm, i915: Fix memory leak in i915_gem_busy_ioctl().
From
On Sat, Nov 26, 2011 at 10:53 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Sat, 26 Nov 2011 22:29:12 +0600, Rakib Mullick <rakib.mullick@gmail.com> wrote:
>> Yes, no real problem with current code. I was just thinking from code
>> cleanup's pov. Is BUG_ON really needed in i915_add_request() ?
>
> No, just documentation as a reminder that the request should be
> preallocated, ideally so that we can fail gracefully without touching
> hardware and leaving it in an inconsistent state wrt to our bookkeeping.
> (This is more apparent in the overlay code which could hang the
> chip/driver if we hit a malloc error too late.)
>
> The BUG_ON has certainly outlived its usefulness.

Actually, I'm not seeing how BUG_ON could trigger (though, I've
wrongly mentioned in previous thread, if request == NULL, BUG_ON could
trigger), it's usefulness will never come into action. Other callers
of i915_add_request also makes sure that, it gets called only if
(request).

Although, kfree(NULL) is permitted, we shouldn't use it unnecessarily.
Anyway, since the issue is not a big deal and no real bug, it could be
droped.

Thanks,
Rakib


\
 
 \ /
  Last update: 2011-11-28 05:33    [W:0.404 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site