lkml.org 
[lkml]   [2015]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] drm: fix a memleak on mutex failure path
From
Date
Hello!

On Apr 27, 2015, at 4:56 AM, Jani Nikula wrote:

> On Sun, 26 Apr 2015, green@linuxhacker.ru wrote:
>> From: Oleg Drokin <green@linuxhacker.ru>
>>
>> Need to free just allocated ctx allocation if we cannot
>> get our config mutex.
>>
>> This one has been flagged by kbuild bot all the way back in August,
>> but somehow nobody picked it up:
>> https://lists.01.org/pipermail/kbuild/2014-August/001691.html
>>
>> Found with smatch.
>>
>> Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
>> CC: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> The function has another leaking failure path, would be nice to have
> that fixed too. Maybe with a common out label.

Hm, you are right, there's another path, though it's less obvious since
what is done with ctx inside of those other calls, but apparently nothing
if there is an error, so it's also a leak.

I'll do an updated patch in a moment.

Bye,
Oleg


\
 
 \ /
  Last update: 2015-04-27 18:01    [W:0.030 / U:1.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site